-
Notifications
You must be signed in to change notification settings - Fork 193
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
Segfaults mod_tile.c:838 -> apr_strtok.c:46 #473
Comments
Hello @zenonp, Thank you for the report, I don't believe openstreetmap.org is using this functionality, so it probably wasn't thoroughly tested, but I think this should be fixed for the upcoming Also, if you are able to test it out and let me know it resolved your issue, that would be helpful. Thanks again and have a great day! |
Hi Thank you for the fix. It might be a bit early to fully confirm it's working, but it's been running for one and a half hour now and I've had exactly zero new coredumps. But I did spot a typo in mod_tile.c:2433: "determin" is missing its final "e" ;) |
Thanks a bunch @zenonp, I'll submit a pull request for that typo, I've been working on increasing test coverage and fixing typos and segmentation faults (luckily I didn't find very many of them) for the last year or so, so I appreciate you helping out by testing it out for your use-case. I was planning on publishing a release of |
I am suddenly seeing a huge number of httpd coredumps (578 in the past three hours, coming from only 10 unique IP addresses), all of them for the same cause:
This is mod_tile passing the contents of X-Forwarded-For to apr_strtok, which then barfs. I don't understand C, but I suspected a type mismatch in apr_strtok expecting string and getting integer or vice versa. So I tried to convert hex 0x7f3a8800fbc8 and 0x7f3aa9d62389 to text, and got 저 and 褀 respectively with UTF-16.
Now, I am not sure that these two hex values were actually sent to apr_strtok, nor that my hex-to-UTF-16 conversion is the correct one, but it seems very likely that these clients are sending garbage in their X-Forwarded-For. Which is easy for anyone to do, accidentally or maliciously. And mod_tile does no sanity check on X-Forwarded-For before passing to apr_strtok whatever it got from the client.
Thus, a sanity check just before mod_tile.c:838 would make a lot of sense, even if my troubleshooting is flawed somehow.
mod_tile 0.7.1, httpd 2.4.62.
The text was updated successfully, but these errors were encountered: