Back to Home

Leak of 400 files through ChatGPT and OAuth

Sola Security employee via OAuth gave ChatGPT access to 400+ company files in 42 ms. Incident revealed shadow AI risks, broad scopes and server processing. Recommendations: permission minimization, token rotation, CASB.

ChatGPT stole 400 company files in a second
Advertisement 728x90

ChatGPT Accessed Over 400 Company Files via OAuth in 42 ms

A Sola Security employee connected ChatGPT to the company's Google Drive using a standard OAuth connection. In 42 milliseconds, AI extracted over 400 internal files, including product roadmaps, financial reports, client plans, and security documents. The security system didn't trigger—no warnings or blocks.

Access happened server-side: requests to the Google API were made from OpenAI's cloud infrastructure, without involving the client device. Data moved outside the corporate environment, where control became impossible. Tokens remained active for 21 days without reauthorization.

How the Leak Happened: OAuth and Excessive Permissions

The OAuth connection was approved in advance, but the permissions turned out to be overly broad. Instead of targeted access to a single file, ChatGPT scanned the entire Drive contents: files, contacts, folder structure. This is a classic case of 'shadow AI'—processes invisible to IT teams.

Google AdInline article slot

Key issues:

  • Broad scope: A single consent granted full access to the entire account.
  • Long-lived tokens: They work for weeks without reauthorization.
  • Server-side processing: Data heads to external servers instantly.
  • No logging: Corporate systems don't record suspicious activity.

As a result, the leak was discovered by chance, weeks later.

Consequences and Risks for Corporate Security

The incident exposed vulnerabilities in LLM integrations with cloud storage. ChatGPT didn't just respond to a query—it scanned the entire drive, exporting sensitive data. Technically all within OAuth rules, but opaque and uncontrollable.

Google AdInline article slot

For mid/senior developers, this is a wake-up call to review:

  • OAuth scopes: Use minimal permissions (e.g., drive.file instead of drive).
  • Token lifecycle: Implement short TTLs and rotation.
  • API proxy: Route requests through a corporate gateway with inspection.
  • DLP integrations: Monitor at the Google Workspace level or equivalents.
  • Shadow AI detection: Scan for unauthorized AI connections.

Such incidents are recurring: similar cases have been reported with integrations in Notion, Slack, and Microsoft Graph.

Key Takeaways

  • 42 ms for 400+ files: Scanning speed outpaces manual audits.
  • Server-side exfiltration: Data leaves without local traffic, bypassing EDR.
  • OAuth pitfalls: Broad scopes + long-lived tokens = hidden risk.
  • Shadow AI: 80% of employees use AI outside IT policies (per Gartner reports).
  • Detection: Only by chance, no automated alerts.

Recommendations for Minimizing Risks

Implement granular controls in integrations:

Google AdInline article slot
# Example of a secure OAuth scope for Google Drive
scopes:
  - https://www.googleapis.com/auth/drive.file  # Only the current file
  - https://www.googleapis.com/auth/drive.readonly # Read-only, without full access

Audit tokens regularly:

# Check active OAuth tokens in Google Workspace
gam print oauthclients

Monitor shadow AI via CASB (Cloud Access Security Broker) tools like Netskope or Zscaler. For dev teams: add CI/CD checks for LLM integrations with PII data.

The Sola Security incident underscores: ChatGPT's default permissions are dangerous for enterprise use. Switch to enterprise versions with audit logs and data residency controls.

— Editorial Team

Advertisement 728x90

Read Next