Description

A new wave of sophisticated phishing attacks is exploiting GitHub's OAuth 2.0 Device Code Flow to hijack developer access tokens, posing a major risk to code repositories and CI/CD infrastructure. Security researchers, including those at Praetorian, have observed that attackers are leveraging the legitimate device authentication mechanism—originally designed for limited-input devices like smart TVs—to trick developers into authorizing access. The attackers initiate the flow, then send the device code and verification URL to victims under the guise of IT support. When the victim unknowingly enters the code, the attacker gains an OAuth token that grants elevated access to the victim’s GitHub resources. The attack is effective because GitHub's device code flow does not validate that the user initiating the flow is the same as the one authenticating it. This loophole enables attackers to carry out targeted social engineering campaigns, convincing users to approve actions that compromise their accounts. Notably, some phishing kits like “GitPhish” automate the entire process using fake GitHub Pages to generate live codes, increasing the success rate of these scams. Once access is granted, attackers can steal proprietary code, manipulate workflows, extract secrets, or even introduce malicious code into supply chains. To mitigate this threat, organizations must enhance monitoring and response strategies. Security teams should monitor audit logs for unauthorized OAuth authorizations and suspicious token scopes. Implementing IP allow-listing, detecting abnormal post-authorization behavior, and training developers to recognize social engineering are critical. As GitHub currently doesn’t allow disabling the device code flow, a proactive security posture is essential to defend against these increasingly targeted attacks.