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

[ruby]: ZipSlip/TarSlip vulnerability detection #728

Closed
1 of 2 tasks
gregxsunday opened this issue Feb 16, 2023 · 12 comments
Closed
1 of 2 tasks

[ruby]: ZipSlip/TarSlip vulnerability detection #728

gregxsunday opened this issue Feb 16, 2023 · 12 comments
Labels
All For One Submissions to the All for One, One for All bounty

Comments

@gregxsunday
Copy link

gregxsunday commented Feb 16, 2023

Query PR

github/codeql#12208

Language

Ruby

CVE(s) ID list

CWE

CWE-022

Report

This query models ZipSlip or TarSlip vulnerabilities where files are extracted from malicious archives without any validation.

I've modelled extracting the files as the source and I've modelled all 3 libraries used by Discourse: Gem::Package::TarReader, Zip::File and Zlib::GzipReader.

The file creation is the sink - I've used already present FileSystemAccess class.

As the sanitizers, I classify const string comparisons or using a File.expand_path function which can be used to resolve the path to then safely validate it. It's like the bug was patched in Discourse.

PS. You should add Ruby to the dropdown above ;)

Are you planning to discuss this vulnerability submission publicly? (Blog Post, social networks, etc).

  • Yes
  • No

Blog post link

I will make a video here: http://youtube.com/c/BugBountyReportsExplained

@gregxsunday gregxsunday added the All For One Submissions to the All for One, One for All bounty label Feb 16, 2023
@ghsecuritylab
Copy link
Collaborator

Your submission is now in status Results analysis.

For information, the evaluation workflow is the following:
Initial triage > Test run > Results analysis > Query review > Final decision > Pay > Closed

@ghsecuritylab
Copy link
Collaborator

Your submission is now in status Query review.

For information, the evaluation workflow is the following:
Initial triage > Test run > Results analysis > Query review > Final decision > Pay > Closed

@github github deleted a comment from ghsecuritylab Mar 7, 2023
@ghsecuritylab
Copy link
Collaborator

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
Copy link
Collaborator

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

@xcorail
Copy link
Contributor

xcorail commented Mar 21, 2023

Created Hackerone report 1914118 for bounty 466027 : [728] [ruby]: ZipSlip/TarSlip vulnerability detection

@xcorail xcorail closed this as completed Mar 21, 2023
@ghsecuritylab
Copy link
Collaborator

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

@gregxsunday
Copy link
Author

Hi @xcorail,
What's the rationale behind awarding this only $1,8k? It's a previously unmodeled bug class, finds a CVE with critical severity, I've modeled 3 different libraries. What else can one do? I'm asking because, with the Ruby promotion only eligible for highs and mediums, the bounty for a high is like three times more...

@xcorail
Copy link
Contributor

xcorail commented Mar 22, 2023

Hi @gregxsunday
Let me check with the team and get back to you

@ghsecuritylab
Copy link
Collaborator

Your submission is now in status Initial triage.

For information, the evaluation workflow is the following:
Initial triage > Test run > Results analysis > Query review > Final decision > Pay > Closed

@ghsecuritylab
Copy link
Collaborator

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
Copy link
Contributor

xcorail commented Mar 27, 2023

Hi @gregxsunday
The team re-evaluated your submission and found new results.
Severity and award were updated accordingly.

Thanks for your patience, we wanted to triage carefully the new results to validate your assumptions.

@gregxsunday
Copy link
Author

Hi @xcorail,
Thank you! I appreciate this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
All For One Submissions to the All for One, One for All bounty
Projects
None yet
Development

No branches or pull requests

3 participants