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

gh-68966: Document mailcap shell injection vulnerability #92024

Closed
wants to merge 5 commits into from
Closed

gh-68966: Document mailcap shell injection vulnerability #92024

wants to merge 5 commits into from

Conversation

vstinner
Copy link
Member

No description provided.

@vstinner vstinner requested a review from a team as a code owner April 28, 2022 15:22
@bedevere-bot bedevere-bot added docs Documentation in the Doc dir awaiting core review labels Apr 28, 2022
@vstinner
Copy link
Member Author

As discussed on the (private) Python Security Response Team, we can simply document the shell command injection vulnerability in the mailcap documentation, as we did for other vulnerabilities:

The Python documentation now even has a list of dangerous APIs / known vulnerabilities: https://docs.python.org/dev/library/security_warnings.html


It seems like there is no simple way to fix the #68966 vulnerability without changing the behavior for legit filenames.

Comment on lines 34 to 35
design, the mailcap format uses shell commands. The caller is responsible to
validate the filename. The caller can create temporary filename, using
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not only about the filename. The MIME type and parameter list need to be validated as well.
Also, how should they be validated? That's not clear.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I rephrased the warning.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The caller is responsible to validate and sanitize input arguments."

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@vstinner
Copy link
Member Author

vstinner commented Jun 6, 2022

#91993 got merged, I close this issue.

@vstinner vstinner closed this Jun 6, 2022
@vstinner vstinner deleted the mailcap_doc branch June 6, 2022 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants