fix: Update utils.go to fix the decoding process of the accessToken BED-7918#111
fix: Update utils.go to fix the decoding process of the accessToken BED-7918#111yuunaka1 wants to merge 2 commits intoSpecterOps:mainfrom
Conversation
The body (JWS Payload) uses Base64URL encoding, not Base64 encoding. Therefore, the base64.RawURLEncoding function must be used for the decoding.
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
@mvlipka @ddlees ProblemEntra ID returns URL-safe base64-encoded JWTs. However, AzureHound attempts to decode them using the standard (non–URL-safe) base64 decoder. As a result, even valid access tokens can trigger a fatal error. Here’s a real example I ran into: |
|
Any chance this can get merged? This is a one-line fix that's been open for over a year. Just hit this exact issue on v2.11.0 with a GCC tenant — see #160 and #186. The The workaround is to use app registration auth ( |
|
@Mike-Crowley Hello! Thank you for the reminder, I'll get this triaged soon 👍 |
WalkthroughThe Changes
Possibly Related Issues
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
https://specterops.atlassian.net/browse/BED-7918 For internal tracking |
The accessToken (JWS Payload) uses Base64URL encoding, not Base64 encoding. Therefore, the base64.RawURLEncoding function should be used for the decoding.
ref: https://datatracker.ietf.org/doc/html/rfc7515#section-7.1
Summary by CodeRabbit