Migrate BC Auth to login.hackers.bugcrowd.com with Legacy Fallback#92
Migrate BC Auth to login.hackers.bugcrowd.com with Legacy Fallback#92voidclick-labs wants to merge 1 commit into
Conversation
|
See #91 |
|
Thanks! Checking this asap |
|
This was already implemented in d1ffb90. But not with the fallback. Are you aware of any account still having the old auth? |
|
Yeah I was seeing that commit, it looks like it was to use a browser token instead of the secrets in bbscope.yaml right? Im unsure about any other account having the old auth. My BC account is newer (made in the last couple of weeks) I genuinely could not auth using the main branch. Im assuming the main branch is working for most if not all users. When I put in a BC help desk ticket to ask why I could not use that auth flow, I was told "There is an ongoing migration of hacker accounts to use the new authentication flow in https://login.hackers.bugcrowd.com/." d1ffb90. Screenshot: ^ I am a little worried this is a "works on my machine/account" situation. |
|
I told claude to keep the auth flow in the main branch in, but the account I have doesnt let me test if it still works or not. Having looked at some previous issues in the repo, it seems bc has had at-least 1 other account migration. Im unsure if this is the same account migration or a new one. If it is a new one, I figured I'd save ya some time. Great tool, thanks for making it, its gonna be my upstream for my automation, and I didnt wanna hit ur website every hour. Lol Sorry its AI code, but shout out Caido Skills for the 1 shot fix. |
|
Seems like other users are reporting they don't have okta yet, considering to merge this soon |
|
Been running this in an hourly cron job since the PR. Havent had any issues yet. |



Full Disclosure I had claude write this code.
Bugcrowd Authentication Changes
Bugcrowd migrated their login from a custom form at
identity.bugcrowd.comto Okta Identity Engine (IDX) atlogin.hackers.bugcrowd.com. This PR updates the auth flow to match and retains the original flow as a fallback.login.hackers.bugcrowd.com(Okta IDX)identity.bugcrowd.comform flow as a silent fallbackNew Auth Flow
Changes
pkg/platforms/bugcrowd/bugcrowd.gonewLoginClient(proxy)— new helper: shared cookie-jar-backedretryablehttp.Clientsetup (previously duplicated). SetsRetryMax = 0to prevent redirect side effects.loginOktaIDX(email, password, otpSecret, proxy)— new primary flow: GETsidentity.bugcrowd.com/login/hacker, follows redirect chain to Okta authorize page, hands off torunOktaIDXFlow.runOktaIDXFlow(client, pageBody, email, password, otpSecret)— new shared helper: executes the full Okta IDX API sequence (introspect → identify → password challenge → TOTP challenge → token redirect). Used by both flows.loginLegacy(email, password, otpSecret, proxy)— renamed from the previous inline logic inLogin(). POSTs toidentity.bugcrowd.com/login, followsredirect_toto Okta authorize page, then callsrunOktaIDXFlow.Login()— now triesloginOktaIDXfirst; falls back tologinLegacyon failure (logged at debug level).Headers Removed
OriginRefererAccept: application/json; okta-version=1.0.0*/*; Okta returns JSON regardlessX-Requested-WithX-Okta-User-Agent-ExtendedUser-Agent,Content-Type, andX-Csrf-Tokenare retained (WAF detection, required by the API, and CSRF protection respectively). Theapplication/ion+json; okta-version=1.0.0content type on the introspect POST is also required.Performance Fix
The original fallback tried the legacy flow first. Since
identity.bugcrowd.com/loginno longer returnsredirect_to, the legacy flow always fails after 2 rate-limited requests (~2s wasted at 1 req/sec). Swapping the order sologinOktaIDXruns first eliminates this overhead in the common case.Test Plan
go run main.go poll bc --config <config>completes login and returns scope data--proxyroutes traffic through the proxy correctly