Linode Forum Index Linode Forum
Linode Community Forums
 


how secure is our systems from /proc/self/environ hack

Click here to go to the original topic

 
       Linode Forum Index -> General Discussion
Author Message
shelleyp



Joined: 12 Dec 2011
Posts: 5

Posted: Mon Dec 12, 2011 9:36 am    Post subject: how secure is our systems from /proc/self/environ hack  

I have the following in my Logwatch log file

---

A total of 3 possible successful probes were detected (the following URLs contain strings that match one or more of a listing of strings that
indicate a possible exploit):

/?file=../../../../../../proc/self/environ%00 HTTP Response 200
/?mod=../../../../../../proc/self/environ%00 HTTP Response 200
/?page=../../../../../../proc/self/environ%00 HTTP Response 200

---

I found the entries in the log, and in the circumstances, the 200 responses don't necessarily mean anything. Still...

This is a file system issue. How secure are our installations from this form of attack?

A site online recommended remounting /proc with nousid. Currently, I believe the default for /proc is usid.

What think? Suggestions?

I'm running Ubuntu 10.04.
Back to top  
GLaDOSDan



Joined: 25 Nov 2010
Posts: 23

Posted: Mon Dec 12, 2011 9:40 am    Post subject:  

This isn't a file system issue. It's an issue with whatever web app you're running. Patching that should be your priority, not the file system.
Back to top  
shelleyp



Joined: 12 Dec 2011
Posts: 5

Posted: Mon Dec 12, 2011 9:50 am    Post subject:  

GLaDOSDan wrote: This isn't a file system issue. It's an issue with whatever web app you're running. Patching that should be your priority, not the file system.

This is a combination of issues: both PHP app security vulnerabilities and file system vulnerabilities, exposed by the PHP app.
Back to top  
obs



Joined: 07 Mar 2010
Posts: 1403
Location: Earth

Posted: Mon Dec 12, 2011 9:54 am    Post subject:  

No it's not /self/proc/environ should be readable by the file system, your issue is with the php app, now if the app could read /etc/shadow then you'd have a file system problem (or your app is running as root which is bad).
Back to top  
shelleyp



Joined: 12 Dec 2011
Posts: 5

Posted: Mon Dec 12, 2011 10:09 am    Post subject:  

obs wrote: No it's not /self/proc/environ should be readable by the file system, your issue is with the php app, now if the app could read /etc/shadow then you'd have a file system problem (or your app is running as root which is bad).


No to both.
Back to top  
Guspaz



Joined: 26 May 2009
Posts: 1150
Location: Montreal, QC

Posted: Mon Dec 12, 2011 10:17 am    Post subject:  

If your web app is accessing random files outside your web root on the file system, the web app is the problem, not the file system. /etc/passwd is also world-readable, I'll point out. If an insecure web app is compromised, there is so much sensitive information that an attacker can read.
Back to top  
shelleyp



Joined: 12 Dec 2011
Posts: 5

Posted: Mon Dec 12, 2011 10:24 am    Post subject:  

Guspaz wrote: If your web app is accessing random files outside your web root on the file system, the web app is the problem, not the file system. /etc/passwd is also world-readable, I'll point out. If an insecure web app is compromised, there is so much sensitive information that an attacker can read.

The only publicly accessing PHP application I'm running is Drupal. Everything else requires authentication.

Thanks for suggestions. Evidently the consensus is this person is wrong

http://www.thesecuritysamurai.com/2011/02/24/the-procselfenviron-vulnerability-by-cesar-salas-stillsecure-soc-analyst/
Back to top  
Azathoth



Joined: 07 Dec 2009
Posts: 263

Posted: Mon Dec 12, 2011 10:28 am    Post subject:  

You found the entries in the log, but did you try the URLs yourself? What do you get?

The response code of 200 means nothing. I am angry at many PHP apps that I have to integrate with because not only are they not even basically restful, but many give you a "Blah not found" while the response code is 200 not 404. Some apps will give you 200 when they're handling even 403 or 5xx.

And at any rate, this is not the issue of the app but of PHP environment. It should be locked down (open_basedir comes to mind, SELinux or similar comes to mind) to its allowed directory environment (plus /dev/urandom, /tmp and stuff like that), period.

so:

Quote: How secure are our installations from this form of attack?

As secure as you make them. Never rely on the app to take care of its security.
Back to top  
shelleyp



Joined: 12 Dec 2011
Posts: 5

Posted: Mon Dec 12, 2011 10:35 am    Post subject:  

Azathoth wrote: You found the entries in the log, but did you try the URLs yourself? What do you get?

The response code of 200 means nothing. I am angry at many PHP apps that I have to integrate with because not only are they not even basically restful, but many give you a "Blah not found" while the response code is 200 not 404. Some apps will give you 200 when they're handling even 403 or 5xx.

And at any rate, this is not the issue of the app but of PHP environment. It should be locked down (open_basedir comes to mind, SELinux or similar comes to mind) to its allowed directory environment (plus /dev/urandom, /tmp and stuff like that), period.

so:

Quote: How secure are our installations from this form of attack?

As secure as you make them. Never rely on the app to take care of its security.

I did, and as you note, all I get is the app's main page, rather than a 404. That's why I'm not sweating the access. But I'm concerned that a 200 return will trigger the hacker into a more determined assault, and I'm tired of the attacks.

I'll look more closely at my PHP installation, see if I can tighten it up further.

Thx
Back to top  
Guspaz



Joined: 26 May 2009
Posts: 1150
Location: Montreal, QC

Posted: Mon Dec 12, 2011 12:56 pm    Post subject:  

shelleyp wrote: Thanks for suggestions. Evidently the consensus is this person is wrong

http://www.thesecuritysamurai.com/2011/02/24/the-procselfenviron-vulnerability-by-cesar-salas-stillsecure-soc-analyst/

So, according to that post and its source, this vulnerability was fixed in July of 2006 in 2.6.17.5. So why is it a still a concern? The post gives no indication about why we should care about a vulnerability fixed half a decade ago.
Back to top  
hoopycat



Joined: 30 Aug 2008
Posts: 1294
Location: Rochester, New York

Posted: Mon Dec 12, 2011 6:22 pm    Post subject:  

shelleyp wrote: I did, and as you note, all I get is the app's main page, rather than a 404. That's why I'm not sweating the access. But I'm concerned that a 200 return will trigger the hacker into a more determined assault, and I'm tired of the attacks.

It's almost certainly automated and not directly controlled by a human, so it will likely not care whether or not something is vulnerable. It will try anyway. The flu doesn't check whether or not you got a flu shot when someone sneezes at you.
Back to top  
 
       Linode Forum Index -> General Discussion
Page 1 of 1