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

Filter Firebase bucket false positives #1105

Closed
wants to merge 3 commits into from

Conversation

oj-sec
Copy link

@oj-sec oj-sec commented Feb 20, 2024

This pull request adds a check to fix false positive Firebase bucket identification where the bucket name contains an '_' (underscore) character.

A Firebase datastore cannot validly have an underscore character in its name and the Firebase API returns a 403 HTTP status code if it does. The current logic expects that only a 404 status code means that the bucket does not exist. This results in buckets that cannot exist on Firebase being identified as existing where the candidate bucket names contain an underscore.

Example Firebase response where an underscore is present (and the bucket does not exist):
1

Example Firebase response where no underscore is present and the bucket does not exist:
2

@oj-sec oj-sec changed the base branch from stable to dev February 20, 2024 22:50
@TheTechromancer
Copy link
Collaborator

TheTechromancer commented Feb 20, 2024

@oj-sec thanks for noticing this! When it comes to cloud providers in BBOT, we track all the provider-specific data in a separate repo, cloudcheck.

Specifically, the regex for the firebase bucket is in this file. Would you mind making a PR there instead?

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (65907a3) 92% compared to head (7647b28) 92%.

Files Patch % Lines
bbot/modules/bucket_firebase.py 67% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##             dev   #1105   +/-   ##
=====================================
- Coverage     92%     92%   -0%     
=====================================
  Files        308     308           
  Lines      19516   19518    +2     
=====================================
  Hits       17913   17913           
- Misses      1603    1605    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oj-sec
Copy link
Author

oj-sec commented Feb 21, 2024

@TheTechromancer you're welcome! Thanks for such an excellent project. I'll resubmit over there

@oj-sec
Copy link
Author

oj-sec commented Feb 21, 2024

closing with blacklanternsecurity/cloudcheck#24

@oj-sec oj-sec closed this Feb 21, 2024
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.

3 participants