Bug 1917807

Summary: Information disclosure via pydoc
Product: [Fedora] Fedora Reporter: david08741
Component: python3.8Assignee: Miro Hrončok <mhroncok>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 32CC: cstratak, mhroncok, python-sig, tcullum, thrnciar, torsava, vstinner
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-10 18:46:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description david08741 2021-01-19 12:23:17 UTC
Description of problem:
running `pydoc -p` allows other local users to extract arbitrary files.

Version-Release number of selected component (if applicable):
python3-3.8.6-1.fc32.x86_64

How reproducible:
if pydoc is running on a port

Steps to Reproduce:
1. start pydoc on a port
2. as a different user guess or extract the port
3. call getfile on the server to extract arbitrary files, e.g. http://localhost:8888/getfile?key=/home/dave/.ssh/id_rsa.pub http://localhost:8888/getfile?key=/etc/shadow

Actual results:
any local user on the multi-user system can read all my keys and secrets

Expected results:
Access is prevented.

Additional info:
At least a warning should be printed, that this is insecure on multi-user systems.

python notebook works around this by providing a token that is required to access the notepad. Depending on the system being able to read arbitrary files can allow to impersonate my, by  e.g. stealing my ssh-key (if it is non-encrypted)

Comment 1 Miro Hrončok 2021-01-19 12:53:10 UTC
Marking this private for now.

Comment 2 Miro Hrončok 2021-01-19 14:17:57 UTC
I've sent this to security

Comment 3 Todd Cullum 2021-03-05 22:03:24 UTC
(In reply to david08741 from comment #0)

Thanks for reporting. May Red Hat Product Security acknowledge you for this report?

If so, please state the name or pseudonym you wish to go by.

Comment 4 david08741 2021-03-08 09:52:21 UTC
Sure, my name is David Schwörer <davidsch at fedoraproject dot org>

Comment 5 Miro Hrončok 2021-03-10 18:46:18 UTC

*** This bug has been marked as a duplicate of bug 1937476 ***