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

Requests which resolve to a FIFO cause denial of service #2

Closed
multiplexd opened this issue Jun 30, 2017 · 2 comments
Closed

Requests which resolve to a FIFO cause denial of service #2

multiplexd opened this issue Jun 30, 2017 · 2 comments
Assignees

Comments

@multiplexd
Copy link

If the requested URL resolves to a FIFO then merecat opens and reads it like a regular file, which leads to a hang (blocking read on the FIFO). Note that this prevents any further connections from being handled. See here for reference.

@troglobit
Copy link
Owner

Thank you for the bug report! 😃

I think I've found the fix in thttpgpd mentioned on the mailing list,
https://github.com/mmuman/thttpgpd/blob/master/src/libhttpd.c#L3725

Simplified:

/* If it is not a regular file or a dir, forbid acces.  */
else if (!S_ISREG(hc->sb.st_mode) ) {
	httpd_send_err(hc, 403, err403title, "", ERROR_FORM(err403form,
                "The requested URL '%.80s' does not resolve to a regular file or a directory"),
		hc->encodedurl );
	return -1;
}

However, I'm considering a 404 instead of 403. Feels like a bit too "blabby" by the web server to leak the above meta data?

@troglobit troglobit self-assigned this Jun 30, 2017
@troglobit
Copy link
Owner

Should be fixed in ffd8fe6. Feel free to re-open the issue should the problem persist!

Thank you again for reporting the bug, not only does it help Open Source in general, it reminded me I need to finialize the work I've done but not yet officially released (HTTPS support etc.)! 😃

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