Skip to content

Critical: CORS misconfiguration with allow_credentials=True and allow_origins=['*'] #138

@namann5

Description

@namann5

Vulnerability Description

A critical CORS misconfiguration exists in backend/app/main.py where allow_origins=["*"] is used alongside allow_credentials=True.

Impact

According to the CORS specification (RFC 6454), when Access-Control-Allow-Credentials: true is set, the Access-Control-Allow-Origin header must specify an explicit origin, not a wildcard. The current configuration allows any external website to make authenticated cross-origin requests to the API.

This means:

  1. An attacker can host a malicious website
  2. When a logged-in InterXAI user visits that site, the attacker's JavaScript can make API calls with the user's credentials (JWT token from Authorization header or cookies)
  3. The browser will include credentials because allow_credentials=True
  4. The attacker can read, modify, or delete user data

Location

backend/app/main.py:46-51

CVSS Score

8.8 (High) - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Fix

The fix restricts allowed origins to specific development URLs and makes them configurable via Settings.CORS_ORIGINS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BackendfrontendReact / TypeScript frontendgssoc2026GSSoC 2026 contribution

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions