Skip to content
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

Missing boundary check before sprintf in process_file function #8913

Closed
VINSERTF128 opened this issue May 7, 2024 · 1 comment
Closed

Missing boundary check before sprintf in process_file function #8913

VINSERTF128 opened this issue May 7, 2024 · 1 comment

Comments

@VINSERTF128
Copy link

VINSERTF128 commented May 7, 2024

Title

Missing boundary check before sprintf in process_file function

Severity

High

Difficulty

Low

Type

Security Issue

Target

components/net/lwip/lwip-2.0.3/src/apps/httpd/makefsdata/makefsdata.c
components/net/lwip/lwip-2.1.2/src/apps/http/makefsdata/makefsdata.c

Description

A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer.


Location 1

A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer.

sprintf(qualifiedName,"%s/%s", curSubdir, filename);

Location 2

sprintf(qualifiedName, "%s/%s", curSubdir, filename);

Exploit Scenario

Recommendations

A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold, or when a program attempts to put data in a memory area outside of the boundaries of a buffer.

Possible fix

use of snprintf in this specific case:
snprintf(qualifiedName, sizeof(qualifiedName), "%s/%s", curSubdir, filename);

Or update the lwip

Permalink:

sprintf(qualifiedName,"%s/%s", curSubdir, filename);

sprintf(qualifiedName, "%s/%s", curSubdir, filename);

If you think this is eligible I would like to apply for CVE-id recognition.

@VINSERTF128 VINSERTF128 changed the title Missing boundary check in before sprintf in process_file function Missing boundary check before sprintf in process_file function May 7, 2024
@mysterywolf
Copy link
Member

Hi this is not a RT-Thread issue, this is from LWIP, please submit this request to LWIP community, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants