Security vulnerability identified while running code on the compiler

Problem description:
Security issue identified while running code on the compiler aka Local File Inclusion (LFI)

Expected behavior:
‘permission denied’ should be the expected behavior as it exposes backend info and an adversary can run OS commands.

Actual behavior:
Displaying sensitive content

Steps to reproduce:
Run the below code and change the file name/path and the file contents will be displayed accordingly.

# Open the file in read mode
with open(‘/proc/self/environ’, ‘r’) as file:

  • Read the contents of the file*

  • contents =*

# Print the contents of the file

Bug appears at this link:

Chrome browser/Win 11

No worries on this, the information you’ve spotted is in the repl’s filesystem and does not pose a security threat.
Thanks for trying to help make replit a safer place!

1 Like

This also includes contents fetched from etc/passwd ?


It’s all good and safe. Only problem would be jailbreaking from the Docker container which is probably not possible. But if you’re still inside your Repl, it’s ok that you can access that stuff.

1 Like

Correct, the information accessible from the repl is all safe and good :+1: