question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Addressing requests to /proc and /sys

See original GitHub issue

Description

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:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
airweencommented, Jul 2, 2021

Does anyone have a Red Hat linux system? They may have some other additions, you can get them with echo /proc/* | xargs -n 1 echo | sort

On Debian 11 I’ve found these additions:

/proc/dynamic_debug
/proc/keys
/proc/pressure

RH 8.2 additions:

/proc/asound

Sles 15 contains mixed of items above.

1reaction
lifeformscommented, Jul 2, 2021

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 also restricted-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 with echo /proc/* | xargs -n 1 echo | sort

/proc/0
/proc/1
/proc/2
/proc/3
/proc/4
/proc/5
/proc/6
/proc/7
/proc/8
/proc/9
/proc/acpi
/proc/buddyinfo
/proc/bus
/proc/cgroups
/proc/cmdline
/proc/config.gz
/proc/consoles
/proc/cpuinfo
/proc/crypto
/proc/devices
/proc/diskstats
/proc/dma
/proc/docker
/proc/driver
/proc/execdomains
/proc/fb
/proc/filesystems
/proc/fs
/proc/interrupts
/proc/iomem
/proc/ioports
/proc/ipmi
/proc/irq
/proc/kallsyms
/proc/kcore
/proc/key-users
/proc/keys
/proc/kmsg
/proc/kpagecgroup
/proc/kpagecount
/proc/kpageflags
/proc/latency_stats
/proc/loadavg
/proc/locks
/proc/mdstat
/proc/meminfo
/proc/misc
/proc/modules
/proc/mounts
/proc/mpt
/proc/mtrr
/proc/net
/proc/pagetypeinfo
/proc/partitions
/proc/sched_debug
/proc/schedstat
/proc/scsi
/proc/self
/proc/slabinfo
/proc/softirqs
/proc/stat
/proc/swaps
/proc/sys
/proc/sysrq-trigger
/proc/sysvipc
/proc/thread-self
/proc/timer_list
/proc/timer_stats
/proc/tty
/proc/uptime
/proc/version
/proc/version_signature
/proc/vmallocinfo
/proc/vmstat
/proc/zoneinfo
/sys/block
/sys/bus
/sys/class
/sys/dev
/sys/devices
/sys/firmware
/sys/fs
/sys/hypervisor
/sys/kernel
/sys/module
/sys/power
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found