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

CVE-2015-3887 - RPATH flaw #60

Closed
pranavk opened this issue May 13, 2015 · 3 comments
Closed

CVE-2015-3887 - RPATH flaw #60

pranavk opened this issue May 13, 2015 · 3 comments

Comments

@pranavk
Copy link

pranavk commented May 13, 2015

https://github.com/rofl0r/proxychains-ng/blob/master/src/main.c#L35
This line loads libproxychains4.so from the current directory which can be used by the attacker to load a manipulated library instead of original libproxychains4.so

ref:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-3887
http://seclists.org/oss-sec/2015/q2/415
http://seclists.org/oss-sec/2015/q2/430

@rofl0r
Copy link
Owner

rofl0r commented May 20, 2015

Thanks for the information. It is a feature of proxychains-ng to allow the user to preload the DSO from the current directory. I understand though that with more and more mainstream distros adopting proxychains-ng it is probably better to ship with more "defensive" default settings. I'm currently thinking about the best way to achieve that, probably with a compile-time switch.

@mtasaka
Copy link

mtasaka commented May 20, 2015

Well, I already told Pranav that when building proxychains-ng (before installing), libproxychains4.so and proxychains are created on the same directory, and when trying to use proxychains4 on the build directory (as ./proxychains4), libproxychains4 on the same directory is loaded, because of own_dir entry, so there should be no problem when trying to use proxychains4 on the build directory (without installing).

On the contrary, allowing arbitrary "." is security flaw. In this sense,
https://github.com/rofl0r/proxychains-ng/blob/master/src/main.c#L51
is also dangerous. If l is 0, some system-wide directory (like "/lib") shoule be returned.

Or you can use realpath(argv0, NULL)
http://man7.org/linux/man-pages/man3/realpath.3.html

@mtasaka
Copy link

mtasaka commented May 20, 2015

Note that realpath() resolves symlink, so using realpath() avoilds symlink attack.

@rofl0r rofl0r closed this as completed in 9ab7dbe May 21, 2015
buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue Sep 19, 2017
Version 4.9 fixes CVE-2015-3887:
rofl0r/proxychains-ng#60

Added md5 & sha1 hashes provided by upstream.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue Sep 21, 2017
Version 4.9 fixes CVE-2015-3887:
rofl0r/proxychains-ng#60

Added md5 & sha1 hashes provided by upstream.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit 9d71b89)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
buildroot-auto-update pushed a commit to buildroot/buildroot that referenced this issue Oct 16, 2017
Version 4.9 fixes CVE-2015-3887:
rofl0r/proxychains-ng#60

Added md5 & sha1 hashes provided by upstream.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit 9d71b89)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
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

3 participants