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

The functionality add attachment to parts allows access to local files. #1229

Open
alestorm980 opened this issue Jan 4, 2022 · 3 comments
Open
Labels
Bug needs-triage incoming, please sort

Comments

@alestorm980
Copy link

Bug description

In PartKeepr before v1.4.0, the functionality to load attachments using a URL when creating a part, allows the use of the file:// URI scheme, allowing local files to be read.

Steps to reproduce

  1. Go to 'Add Part'.
  2. Click on 'Attachments'.
  3. Click on 'Add'.
  4. Fill the 'URL' field with "file:///etc/passwd".
  5. Click on the uploaded file in order to see the content.

Expected behavior

The application should not allow access to local files.

Observed behavior

Local paths can be used to read files on the system.

Screenshots and files

path_file

passwd_content

System Information

  • PartKeepr Version: v1.4.0 and v0.1.9
  • Operating System: Linux
  • Web Server: Apache
  • PHP Version: 7.4
  • Database and version: Mysql
  • Reproducible on the demo system: Yes.
@alestorm980 alestorm980 added Bug needs-triage incoming, please sort labels Jan 4, 2022
@Gasman2014
Copy link

Gasman2014 commented Jan 4, 2022 via email

@alestorm980
Copy link
Author

alestorm980 commented Jan 4, 2022

Yes, it is possible to read files within the server to which the user running the application has access, this includes source code, system configuration files, ssh keys, etc.

For example here an attacker can read a ssh key from the user running the application.

lfi_rsa

@alestorm980
Copy link
Author

I attach the link to the advisory https://fluidattacks.com/advisories/hendrix/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug needs-triage incoming, please sort
Projects
None yet
Development

No branches or pull requests

2 participants