Integer overflow at line 1603 in the src/operator.c file
A very large value passed to the retry-max-time option causes a multiplication by 1000 to overflow in the operator source file. The result is that the retry-max-time setting becomes an illegal value, though the text does not show any further consequence.
- Disclosed after 18 months
Summary:
[add summary of the vulnerability] On systems with a 64 bit, if —retry-max-time > 18446744073709552, config->retry-max-time*1000L will be overflow at line 1603 in the src/operator.c file. Similarly, the same is true for 32-bit operating systems.
Steps To Reproduce:
[add details for how we can reproduce the issue]
- [add step]
run: curl --retry-max-time 18446744073709552 -v 127.0.0.1:8080/test.html
- [add step]
- [add step]
Supporting Material/References:
[list any additional material (e.g. screenshots, logs, etc.)]
- [attachment / reference]
Impact
If the integer overflow is triggered, the parameter retry-max-time will be illegal.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the code multiplies the user-supplied retry-max-time value by 1000 without checking that the result fits in the integer type, so a very large input overflows.
Impact
The retry-max-time parameter becomes an illegal value, which could make the retry timing behave incorrectly; the text does not claim any crash or security consequence.
What the attacker needed
Ability to pass command-line options to curl
How it was found
- Run curl with a very large retry-max-time value against a local test address.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A program stores a number in a fixed-size slot, and multiplying a huge number by 1000 makes it wrap around to a small or negative value. Here the retry-max-time option, which controls how long curl keeps retrying, is multiplied by 1000 and the result no longer fits. The report only says the setting ends up invalid; it does not show a crash or any other harm.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.