You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python] Unsafe Unpacking and TarSlip bug slaying #759
Each published report is specific and I have been using mainly GitHub private vulnerability reporting.
For the 05 CVEs, the vulnerability report identifies the source/sink vulnerable code.
I did not run variant analysis at scale, since when I started reporting the TarSlip/Unsafe extraction cases, back in December 2022, it was not yet released for public use.
I want to add that it is a bit difficult to convince using the CVSS scoring system maintainers about the severity. Some of them consider it High severity, others succumb to a bit of subjectivity.
Are you planning to discuss this vulnerability submission publicly? (Blog Post, social networks, etc).
I want to add that it is a bit difficult to convince using the CVSS scoring system maintainers about the severity. Some of them consider it High severity, others succumb to a bit of subjectivity.
Agreed, for that reason, I would like to reevaluate the severity assigned for the 3 medium/moderate CVEs. Can you provide a brief explanation for each of them detailing why they should have a higher severity? (Please include 1) How can an attacker control the untarred file, 2) permissions required and 3) Impact of being able to override a file for those specific systems)
The source of url is a tarball hosted in the PyPI repository.
Any developer could publish a package in tarball format using twine.
When "guarddog" package is running it would retrieve the remote tarball and download_compressed. Which would lead to arbitrary file creation/overwrite.
The report was made through GitHub's private reporting feature in here. I suggested the "Scope" metric needs to be Changed since the affected component and the vulnerable one are not the same (the underlying filesystem and gpdb). The malicious tarball could come from CLI in the gpdb CI tool.
The vulnerable code was similar to:
# untar the package into tmp folderwithclosing(tarfile.open(self.gppkg.abspath)) astarinfo:
tarinfo.extractall(TEMP_EXTRACTION_PATH)
An attacker can use this vulnerability to overwrite data or system files potentially leading to a crash or malfunction of the system. That is what the final advisory suggests. As an ethical hacker, I believe with a maliciously crafted tarball, I could own that machine (overwrite a private ssh key for instance) but that would depend on the user's permission to write on ~/.ssh/.
This one is pure gold. The vulnerability was a rare full TarSlip (upload <> download any file). I mean you upload through a web app feature a malicious tarball with a symlink, that gets extracted within the server context using the web app user privileges, and then you could download any file pointed out by the symlink.
PS: You need an authenticated user and the web app is recommended to remain local, with no remote exposure.
Thanks for the additional input. We have reconsider the CVSS assigned to CVE-2022-23530 and CVE-2022-3607 and therefore the submission qualifies for the bounty.
Activity
pwntester commentedon Jun 12, 2023
Hi @Sim4n6
Thanks for the submission!
Agreed, for that reason, I would like to reevaluate the severity assigned for the 3 medium/moderate CVEs. Can you provide a brief explanation for each of them detailing why they should have a higher severity? (Please include 1) How can an attacker control the untarred file, 2) permissions required and 3) Impact of being able to override a file for those specific systems)
Sim4n6 commentedon Jun 12, 2023
Hi @pwntester
Thank you very much for considering a severity reevaluation.
I would provide details on each moderate severity CVE in separate comments, please.
@Sim4n6
Sim4n6 commentedon Jun 12, 2023
CVE-2022-23530
The vulnerability was reported in GHSA-78m5-jpmf-ch7v. I've asked the maintainers for a CVE score reevaluation DataDog/guarddog#223 but with no success ...
The vulnerable code is L153-L158 :
Steps in Code
urlis a tarball hosted in the PyPI repository.Sim4n6 commentedon Jun 12, 2023
CVE-2023-31131
The report was made through GitHub's private reporting feature in here. I suggested the "Scope" metric needs to be Changed since the affected component and the vulnerable one are not the same (the underlying filesystem and gpdb). The malicious tarball could come from CLI in the gpdb CI tool.
The vulnerable code was similar to:
An attacker can use this vulnerability to overwrite data or system files potentially leading to a crash or malfunction of the system. That is what the final advisory suggests. As an ethical hacker, I believe with a maliciously crafted tarball, I could own that machine (overwrite a private ssh key for instance) but that would depend on the user's permission to write on ~/.ssh/.
Sim4n6 commentedon Jun 12, 2023
CVE-2022-3607
This one is pure gold. The vulnerability was a rare full TarSlip (upload <> download any file). I mean you upload through a web app feature a malicious tarball with a symlink, that gets extracted within the server context using the web app user privileges, and then you could download any file pointed out by the symlink.
PS: You need an authenticated user and the web app is recommended to remain local, with no remote exposure.
pwntester commentedon Jun 13, 2023
Thanks for the additional input. We have reconsider the CVSS assigned to CVE-2022-23530 and CVE-2022-3607 and therefore the submission qualifies for the bounty.
ghsecuritylab commentedon Jun 13, 2023
Your submission is now in status Final decision.
For information, the evaluation workflow is the following:
Initial triage > Test run > Results analysis > Query review > Final decision > Pay > Closed
ghsecuritylab commentedon Jun 13, 2023
Your submission is now in status Pay.
For information, the evaluation workflow is the following:
Initial triage > Test run > Results analysis > Query review > Final decision > Pay > Closed
ghsecuritylab commentedon Jun 13, 2023
Your submission is now in status Closed.
For information, the evaluation workflow is the following:
Initial triage > Test run > Results analysis > Query review > Final decision > Pay > Closed
xcorail commentedon Jun 13, 2023
Created Hackerone report 2023841 for bounty 488338 : [759] [Python] Unsafe Unpacking and TarSlip bug slaying