Skip to content

security: CORS default trusts entire 192.168.42.0/24 over HTTP #101

Description

@pparage

Problem

The default CORS origin regex trusts the entire 192.168.42.0/24 lab subnet over plain HTTP, not just localhost.

Evidence

app/core/config.py:70 — default:
^https?://(localhost|127\.0\.0\.1|\[::1\]|192\.168\.42\.\d{1,3})(:\d+)?$

CORS is configured with allow_credentials=True.

Impact (High)

Any device on the deployment LAN (e.g. a compromised lab VM) can make credentialed cross-origin requests to the API. Combined with the no-auth-in-this-layer model (Kong is bypassed on direct access) and token-in-response exposure, this widens the blast radius significantly.

Suggested fix

Default to localhost-only; require an explicit, narrow CORS_ORIGIN_REGEX per deployment; prefer HTTPS-only. Document that subnet-wide origins are opt-in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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