-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lambdas in node 18.x (18.20.3) and problems with axios HPE_INVALID_HEADER_TOKEN #53196
Comments
I believe there might have been an llhttp update (Probably https://nodejs.org/en/blog/vulnerability/april-2024-security-releases) and you are parsing invalid http. cc @ShogunPanda |
Hello, this is an example of the headers received in that HTTP request. "content-type" : "application/json", Using the insecureHTTPParser all requests pass fine. |
Version
18.20.3
Platform
No response
Subsystem
No response
What steps will reproduce the bug?
Hello everyone
Recently my newly deployed lambdas projects have started having problems with axios.
To give context, I had some lambdas in node, the last time they were deployed it was in LTS node 18.20.1, this week the lambdas have been redeployed, some without adulterating the logic and the axios calls that previously worked now throw the error " HPE_INVALID_HEADER_TOKEN", "Parse Error: Unexpected whitespace after header value."
It should be noted that the lambda that makes the call, as well as the one that returns the response, have not modified their behavior, the only thing that coincides is the launch of node 18.20.3 LTS a few days ago.
Initially using axios 1.6.8 and 1.7.1, tested with the latest version 1.7.2 and gives the same error.
Have you experienced something familiar or have some idea how to solve it, because setting the --insecure-http-parser flag makes it work, but it is not a viable option for me.
The headers were validated and do not contain white spaces at the beginning, at the end, or after the comma.
How often does it reproduce? Is there a required condition?
Whenever a request is made with axios
What is the expected behavior? Why is that the expected behavior?
Get a 200 response
What do you see instead?
HPE_INVALID_HEADER_TOKEN error, Parsing error: Unexpected whitespace after header value
Additional information
We are aware that the problem has occurred in lambdas deployed since Friday, May 25, but we cannot establish a start date for the problem.
The text was updated successfully, but these errors were encountered: