Visitar URL original
Directory traversal in uu module / uu.decode · Issue #99889 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20230130231353/https://github.com/python/cpython/issues/99889
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

Directory traversal in uu module / uu.decode #99889

Open
hannob opened this issue Nov 30, 2022 · 0 comments
Open

Directory traversal in uu module / uu.decode #99889

hannob opened this issue Nov 30, 2022 · 0 comments
Labels
type-bug An unexpected behavior, bug, or error type-security A security issue

Comments

@hannob
Copy link

hannob commented Nov 30, 2022

Bug report

The function uu.decode is vulnerable to trivial directory traversal if no output filename is given. An uu-encoded file with a path starting with a repetition of ../../ or a / allows writing a file to an arbitrary location on the filesystem.

I reported this to security@python.org and was asked to report it publicly as the function is rarely used and removal is planned anyway for Python 3.13.

Your environment

CPython versions tested on: 3.10.8
Operating system and architecture: Linux

example files

Case 1:

begin 644 ../../../../../../../../tmp/test1
$86)C"@``
`
end

Case 2:

begin 644 /tmp/test2
$86)C"@``
`
end
@hannob hannob added the type-bug An unexpected behavior, bug, or error label Nov 30, 2022
@sobolevn sobolevn added the type-security A security issue label Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error type-security A security issue
Projects
None yet
Development

No branches or pull requests

2 participants