Integer overflows in tool_operate.c at line 1541
An integer overflow occurs in curl's tool_operate.c when the --retry-delay option is set to a very large value, causing the delay calculation to wrap around. This results in an invalid retry delay, but the report does not claim any further security impact.
- Disclosed after 17 months
Summary:
[add summary of the vulnerability] In tool_operate.c at line 1541, if --retry-delay>18446744073709552, config->retry_delay*1000 > 2^64 results in integer overflows, on 64 bit architectures;
Steps To Reproduce:
[add details for how we can reproduce the issue]
- [add step]
Tool_operate.c add a "printf" at line 1538 as following: printf("config->retry_delay1000L = %ld\n", config->retry_delay1000L); 2. [add step]
make
- [add step]
run command:
./src/curl --retry-delay 18446744073709552 -v 192.168.222.1:8080/test.html
output:
config->retry_delay*1000L = 384
Supporting Material/References:
[list any additional material (e.g. screenshots, logs, etc.)]
- [attachment / reference]
Impact
The flaw exists on 32&64 bit architectures, it results in retry-delay is invalid.
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 multiplication of the retry delay by 1000 is performed without checking for integer overflow, so a very large input wraps around.
Impact
The retry delay becomes invalid, but the report does not describe any further security consequence.
What the attacker needed
Ability to set --retry-delay to a very large value
How it was found
- Add a printf statement at line 1538 to print the result of config->retry_delay*1000L.
- Build curl with make.
- Run curl with the --retry-delay option set to 18446744073709552 and a test URL.
- Observe the printed value is 384, showing the overflow.
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.
When a program multiplies two numbers, the result can be too big to store in the variable, so it wraps around to a small number. Here, a huge retry delay multiplied by 1000 overflows, making the delay become a tiny value instead of the intended large one. This is a bug, but the report does not show how an attacker could use it to do 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.