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

fix: prevent enumeration of private repo #614

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

kyokugirl
Copy link
Contributor

@kyokugirl kyokugirl commented Dec 6, 2024

This PR fixes the issue by:

  • making checkIfReadable to return RepoNotFound instead of Unauthorized
  • changing all commands that works on a repo to run checkIfReadable before performing anything
  • updating tests to reflect the changes

Closes #595

@kyokugirl
Copy link
Contributor Author

It doesn't look like that the CI failure is caused because of the changes of this PR.... Can someone look into this?

@aymanbagabas
Copy link
Member

It doesn't look like that the CI failure is caused because of the changes of this PR.... Can someone look into this?

You're right, the CI fails because of changes not related to this PR 🙂

@aymanbagabas
Copy link
Member

@kyokugirl Could you please rebase onto main?

@kyokugirl
Copy link
Contributor Author

@aymanbagabas Done ✅

Copy link

codecov bot commented Dec 7, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 3 lines in your changes missing coverage. Please review.

Project coverage is 51.72%. Comparing base (b06b555) to head (f2f2219).
Report is 94 commits behind head on main.

Files with missing lines Patch % Lines
pkg/ssh/cmd/cmd.go 66.66% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #614      +/-   ##
==========================================
- Coverage   51.96%   51.72%   -0.24%     
==========================================
  Files         157      159       +2     
  Lines       13454    13557     +103     
==========================================
+ Hits         6991     7012      +21     
- Misses       5891     5973      +82     
  Partials      572      572              

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

@aymanbagabas aymanbagabas merged commit 1de446f into charmbracelet:main Dec 8, 2024
12 checks passed
@aymanbagabas
Copy link
Member

Thank you @kyokugirl!

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.

Privat repository enumeration
2 participants