Skip to content
Memory corruption Disclosed report Intermediate

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.

cjun Follow

Originally disclosed on HackerOne

  • 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]

  1. [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

  1. [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.

The original report as published on HackerOne, by cjun. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

  1. Add a printf statement at line 1538 to print the result of config->retry_delay*1000L.
  2. Build curl with make.
  3. Run curl with the --retry-delay option set to 18446744073709552 and a test URL.
  4. 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.

More by cjun

View all

1 more disclosed report, best first.

More from curl

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.