-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
sysmodule.c: realpath() is unsafe #42400
Comments
|
realpath() will dereference all symlinks and resolve There is no way to specify how long your "resolved" According to the man page: BUGS glibc has certain extensions to avoid the buffer info libc Attached is a patch to use canonicalize_file_name if |
|
Logged In: YES there are two bugs in the patch: one is explained on i have a patch, but don't know how to attach it - should i |
|
Logged In: YES There are actually a few more, very subtle problems with the In general, regarding Red Hat's bz# 169046, there's no |
|
Logged In: YES ... but I see you meant the condition different than I |
|
Logged In: YES if I may kindly remind you that this is a good time to I have a working patch, applicable against 2.5c1, at |
|
The patch introduces a memory leak, canonicalize_file_name() returns a |
|
Disclaimer: this bug is more than 3 years old, I don't remember all the Victor, solely reading the patch I see: +#ifdef HAVE_CANONICALIZE_FILE_NAME so argv0 (the string where the results of canonicalize_file_name() is Is there another branch that does not hit this code, that would create |
|
Surely this security issue should be addressed? |
|
The latest POSIX versions (*) allow NULL to be passed for the target memory area, meaning that realpath() will allocate as much memory as necessary by itself. This essentially does the same thing as canonicalize_file_name(), but in a standard way rather than by relying on a GNU extension. I suppose that possibility could be checked at configure time. (*) http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html |
|
It's a real shame the original patch was not applied before py3k was branched, the code is now different. Antoine, my autoconf knowledge is limited, I don't know how you'd test for realpath accepting a NULL argument (and doing the right thing) at compile time. My involvement with this bug is fairly limited at this point, I would like to see it fixed, but having seen no movement on it for almost 6 years now, maybe it's not as critical as I thought it was. |
|
See issue bpo-12801: it has a more recent patch. |
|
Victor, bpo-12801 was closed. What about this ticket? |
|
We do still use |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: