Skip to content

Fix auth vulnerability - #2805

Merged
gmlewis merged 2 commits into
google:masterfrom
gmlewis:fix-auth-bypass
Jun 12, 2023
Merged

Fix auth vulnerability#2805
gmlewis merged 2 commits into
google:masterfrom
gmlewis:fix-auth-bypass

Conversation

@gmlewis

Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
@codecov

codecovBot commented Jun 12, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2805 (49af546) into master (3efdd2c) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@ Coverage Diff @@## master #2805 +/- ##
=======================================
Coverage 98.06% 98.06% =======================================
Files 132 132 Lines 11650 11655 +5 =======================================
+ Hits 11424 11429 +5 
Misses 154 154 Partials 72 72 
Impacted FilesCoverage Δ
github/messages.go100.00% <ø> (ø)
github/event.go100.00% <100.00%> (ø)
github/repos_contents.go87.82% <100.00%> (+0.23%)⬆️

@gmlewis
gmlewis merged commit a23606b into google:masterJun 12, 2023
@gmlewis
gmlewis deleted the fix-auth-bypass branch June 12, 2023 23:39
@molnarg

Copy link
Copy Markdown

It's a bit fishy, not sure if it can be bypassed by encoding the dots. Using https://pkg.go.dev/net/url#URL.ResolveReference and seeing if the result is different than the input would be a more bulletproof way to do it. Also, it could be applied to the whole u := fmt.Sprintf("repos/%s/%s/contents/%s", owner, repo, escapedPath) path, to ensure there is no ../ in any of the other parameters either.

@gmlewis

Copy link
Copy Markdown
CollaboratorAuthor

@molnarg - PRs are welcome. Thank you.

@k0ral

Copy link
Copy Markdown
Contributor

Could we get more information on the actual vulnerability this is protecting from, and the timeline to its resolution, if any ? Right now, I am considering multiple options:

  • submitting a PR to use a catchable sentinel error
  • submitting a PR to make that protection an opt-out
  • waiting for the vulnerability to be fixed, then submitting a PR to remove that protection

As I cannot find any reference to the vulnerability in the GitHub API documentation, I have difficulty making an informed decision 🙂 .

@gmlewis

Copy link
Copy Markdown
CollaboratorAuthor

@mrbobbytables - are you able to share any more information on the vulnerability that was reported to you?

@ran-arigur

Copy link
Copy Markdown

@mrbobbytables : Would you happen to know (1) whether this vulnerability still exists and (2) whether the vulnerability affects any paths that literally contain .. as a substring (as this change implies), rather than just paths that contain .. as a path component (which is more understandable IMHO)? I ask because there's no good way to work around this check in cases where a file– or directory-name happens to actually include .., so if the check can safely be narrowed, that would be very helpful.

jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto 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.

5 participants

@gmlewis@molnarg@k0ral@ran-arigur@mrbobbytables