Skip to content

Conversation

TrellixVulnTeam
Copy link

Patching CVE-2007-4559

Hi, we are security researchers from the Advanced Research Center at Trellix. We have began a campaign to patch a widespread bug named CVE-2007-4559. CVE-2007-4559 is a 15 year old bug in the Python tarfile package. By using extract() or extractall() on a tarfile object without sanitizing input, a maliciously crafted .tar file could perform a directory path traversal attack. We found at least one unsantized extractall() in your codebase and are providing a patch for you via pull request. The patch essentially checks to see if all tarfile members will be extracted safely and throws an exception otherwise. We encourage you to use this patch or your own solution to secure against CVE-2007-4559. Further technical information about the vulnerability can be found in this blog.

If you have further questions you may contact us through this projects lead researcher Kasimir Schulz.

@wombelix
Copy link

There are ~55k PRs like this: https://github.com/search?q="Patching+CVE-2007-4559"&type=pullrequests
Searching around, some people merged the suggested patch, most reactions are it's spam and might not even address the CVE in question.
I know that moin 1.9 doesn't receive updates anymore, but I would love to hear from the moinmoin maintainers if it might worth to apply this patch to existing 1.9 installations or not.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Sep 17, 2024

Thanks for the PR, somehow it did not show up in my GH notifications...

@TrellixVulnTeam Yeah, that is a serious bug in tarfile.extract, exploit via ../* tarfile members possible.

In this specific case, the code is not MoinMoin code, but a bundled version of the pygments library. Interesting that they dynamically download and extract a tar from a php site.

Considering the amount of PRs mentioned by @wombelix, I suspect you did not test that patch within moinmoin, but it is rather something auto-created?

The proposed code change looks good at first glance. Guess even better would be to re-bundle a fixed (but compatible) version of pygments to solve this and maybe also other issues.

But in any case: there are no moin 1.9.x releases planned anymore. The only exception I guess would be some bigger security issue(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants