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

core: error_log: better handle invalid error log file name #505

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

thomasmey
Copy link

if error log file name is an invalid string, ap_server_root_relative will return NULL, which will result in SIGSEGV in ap_make_dirstr_parent

@covener
Copy link
Member

covener commented Jan 6, 2025

What's an invalid string? Can it be reached via configuration?

@thomasmey
Copy link
Author

I have the fuzzer corpus on my harddrive, i can send it to you directly or maybe upload somewhere

server/core.c Outdated
char *dir;
apr_finfo_t finfo;
apr_status_t rv;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why broader scope for these if still used only within the else?

server/core.c Outdated
apr_status_t rv = apr_stat(&finfo, dir, APR_FINFO_TYPE, p);
if (!abs) {
ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_EMERG, 0,
ap_server_conf, APLOGNO(02291)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be APLOGNO()initially and then can be filled in after committed.

if (!abs) {
ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_EMERG, 0,
ap_server_conf, APLOGNO(02291)
"Cannot construct error log file path '%s'", s->error_fname);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you include the input that triggers this? Hopefully in a way as simple as httpd.conf content rather than calling these functions directly.

if error log file name is an invalid string, ap_server_root_relative will return NULL, which will result in SIGSEGV in ap_make_dirstr_parent
@thomasmey thomasmey force-pushed the bugfix/ap_config_fuzzing3 branch from 2a91c15 to 448cea2 Compare January 7, 2025 20:26
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

Successfully merging this pull request may close these issues.

2 participants