-
Notifications
You must be signed in to change notification settings - Fork 430
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
iniparser_getboolean() can segfault on malformed config files #125
Comments
Add a null pointer check
There are similar problem in |
- iniparser_getstring() returns `NULL` on some condition and it can cause crash
- iniparser_getstring() returns `NULL` on some condition and it can cause crash
- iniparser_getstring() returns `NULL` on some condition and it can cause crash
- iniparser_getstring() returns `NULL` on some condition and it can cause crash
I tried to reproduce the issue without success. Maybe I am missing something. Steps to reproduce:
[Pizza:ham]
This is the result:
There is no segfault. What am I missing? |
@lmoellendorf |
Good to see this is resolved now. I'm trying to understand the reporting + patch history of this security issue.
@ndevilla the |
@lmoellendorf has kindly accepted to take the lead and process most issues and PRs on this project. Thanks a lot Lars! |
During recent fuzzing of the iniparser library via libFuzzer, I've discovered that iniparser can run into a segfault when parsing malformed configuration files.
As far as I can see, this is a local denial of service problem for some programs if attackers are able to provide or modify configuration files (and know which boolean configuration keys are fetched).
The following code position leads to the crash:
iniparser/src/iniparser.c
Line 557 in f858275
Sanitizer crash info:
The custom fuzzer harness is structured similarly to the iniexample.c example code. The relevant call after loading the target configuration tries to load the
p:h
key:The following configuration file will lead to problems for the boolean fetch mentioned above:
[P:h]
Note:
p:h
was chosen arbitrarily as a shorter version of thepizza:ham
key in the code example and has no special significance beyond that.I've reported this finding privately to @ndevilla and @touilleMan.
@ndevilla has responded quickly and asked me to create a public issue report for it here.
The text was updated successfully, but these errors were encountered: