Repository navigation
Reject an OAuth callback whose state does not match this browser (OCU-01-018) - #1820
Open
Dhirenderchoudhary wants to merge 3 commits into
Open
Dhirenderchoudhary wants to merge 3 commits into
Dhirenderchoudhary wants to merge 3 commits into
Conversation
Member
|
Thank you for the PR, appreciate the security eyes on unreleased software, will review when I have an opportunity. Also, much of this code is undergoing development/changes. |
Member
|
@michaelrsweet This PR is the only still missing to complete the fixes of the bugs reported by the STA-sponsored security audit by 7A Security. Therefore it would be great if the PR could get merged (or the bug fixed in any form) soon, so that I can give them the final report that we have fixed all the bugs. could you review it in the next days? Thanks. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
7ASecurity audit of OpenPrinting, finding OCU-01-018, WP1, Medium.
The web login callback is a GET.
finish_logintook the authorization code and setCUPS_BEARER.cgiInitializecompares state only for POST, so this callback never hit that check.do_loginalready stores the state inCUPS_OAUTH_STATE. A browser that opens someone else's callback can be logged in as that other account.The changes
finish_loginrejects the callback whenstateis missing or does not matchCUPS_OAUTH_STATE. That happens before the token request, so no bearer cookie is set.cgi-binalready has tests, so I addedtestoauth.shnext to them. It runshome.cgiagainst a local token server. The cookie isCUPS_OAUTH_STATE=victim. Stateattacker, and a callback with no state, both say the login state does not match and do not setCUPS_BEARER. StatevictimsetsCUPS_BEARER. I ran it and it passed.I also ran the old
home.cgi. That one setCUPS_BEARERfor stateattacker.I left the shared PKCE verifier as it is. Issue 1556 and pull request 1741 are the device-grant replacement.