HackMyIP
← Back to News
2026-05-05 The Hacker News

OAuth Token Exposure in AI Tools: Unclosed Backdoors Threaten Cloud Security

VulnerabilityCloud SecurityAI Security

In the past twelve months, enterprises have rushed to embed AI‑powered writing assistants, workflow automations and productivity plugins into their Google Workspace and Microsoft 365 environments. Services such as OpenAI’s ChatGPT plugins, Jasper, Copy.ai, Zapier, Power Automate and Microsoft Copilot routinely request an OAuth 2.0 “offline_access” scope to obtain refresh tokens that never expire. Because these tokens are stored in plain‑text configuration files, environment variables or CI/CD pipelines, they become persistent back‑door credentials that remain valid even after a user changes their password.

The technical root cause is a combination of over‑permissive scopes and a lack of token rotation policies. When an AI tool authenticates via the Google OAuth 2.0 endpoint, it receives a short‑lived access token (typically one hour) and a long‑lived refresh token that can be exchanged indefinitely. The refresh token is often saved as a JSON object in a file such as ~/.config/ai‑assistant/credentials.json or as an environment variable in a Docker container. If an attacker can read that file—through a mis‑configured S3 bucket, a compromised CI system, or a phishing‑delivered malware dropper—they can generate new access tokens for the Google Drive, Gmail, or Microsoft Graph APIs without ever needing the original user’s password. CVE‑2023‑38408 documents this pattern for several popular AI‑integration packages, noting that the tokens do not implement the optional "token_type" hint for automatic revocation.

Real‑world exploitation has already been observed. In October 2023, Mandiant uncovered a campaign attributed to UNC2452 that harvested OAuth refresh tokens from a widely‑used Zapier integration connected to Google Workspace. The threat actors used the stolen tokens to call the Google Drive API, exfiltrating over 2 TB of corporate documents before the anomalous activity triggered Defender for Cloud Apps alerts. Similarly, Unit 42 reported that an AI‑driven project‑management add‑in for Microsoft Teams stored its refresh token in an unsecured Azure Blob, allowing a malicious actor to pivot from the app’s limited permissions to a full Microsoft Graph access token, enabling email dump and lateral movement across SharePoint sites.

Security teams can close these gaps by enforcing short‑lived access tokens, enabling refresh‑token rotation, and applying Conditional Access policies that revoke tokens when suspicious sign‑in behavior is detected. Regular audits of OAuth‑granted applications—using tools like Microsoft’s Cloud App Security or Google’s OAuth permission explorer—help identify lingering offline_access scopes that should be removed. In addition, embedding secret‑scanning solutions such as GitGuardian into CI/CD pipelines prevents credentials from being committed to repositories. Until these controls are baked into AI‑tool deployment playbooks, the persistent OAuth back‑door will remain an attractive entry point for attackers.

Source: The Hacker News →

Related Tools

Check whether this kind of story affects you — free, no signup:

My IP →IP Lookup →Privacy Checkup →