Addressing requests to /proc and /sys
See original GitHub issueDescription
We do not really cover requests to /proc
as LFI attempts. I am not sure the whole tree can be blocked, but it has to be assessed what can be done about it.
Your Environment
irrelevant
Confirmation
[X] I have removed any personal data (email addresses, IP addresses, passwords, domain names) from any logs posted.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
proc(5) - Linux manual page - man7.org
The proc filesystem is a pseudo-filesystem which provides an interface to kernel data structures. It is commonly mounted at /proc. Typically, it is...
Read more >/proc - The Linux Documentation Project
Examining the contents of the file dynamically gathers the associated data and displays it to the screen. Most of the /proc file system...
Read more >Documentation for /proc/sys/kernel
This file contains documentation for the sysctl files in /proc/sys/kernel/ . The files in this directory can be used to tune and monitor...
Read more >E.3.9. /proc/sys/ Red Hat Enterprise Linux 6
This directory contains an array of options and information concerning various aspects of the file system, including quota, file handle, inode, and dentry ......
Read more >/proc File - IBM
The /proc file system provides access to the state of each active process and ... A read or write request beginning at an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On Debian 11 I’ve found these additions:
RH 8.2 additions:
Sles 15 contains mixed of items above.
I think blocking just the string
/proc/
might cause a little of FP so I’m tempted to make an exhaustive listing of our/proc
filesystems to block as much as possible while steering clear of FP.Note that we have already some proc entries in
lfi-os-files.data
. We have alsorestricted-files.data
. I think the entries should be added to both (so they are blocked as REQUEST_FILENAME but also as form parameters).We also should think of
/sys/
.I think we can do with a simple text match (pmFromFile) since that is easier to maintain, and these strings seem quite technical so would be extremely rare in normal requests. (Although, I can think of a REST API that does https://example.com/api/proc/1 to retrieve a “proceeding” or “process”, so it’s an option to remove those from
restricted-files.data
as it may hurt APIs. I’m not totally decided about that, opinions welcome!)The following proc and sys strings are from Ubuntu 18.04 and Ubuntu 20.04 systems. I turned the pids (e.g.
/proc/1234
) into 10 strings that match all possible pids. Does anyone have a Red Hat linux system? They may have some other additions, you can get them withecho /proc/* | xargs -n 1 echo | sort