Skip to content

[Security] CORS failures not distinguished from generic network errors in axios interceptors #783

Description

@RUKAYAT-CODER

Overview

axios.config.ts treats CORS failures and generic network errors identically. CORS rejections often indicate a misconfigured backend or a man-in-the-middle scenario and should be flagged separately in monitoring.

Specifications

Features:

  • Detect CORS errors by checking error.message for "Network Error" with a 0 status code on non-GET requests
  • Log CORS failures to Sentry with a distinct cors_failure tag

Tasks:

  • Add CORS detection logic in the response error interceptor
  • Create a distinct Sentry issue category for CORS errors
  • Write a test that mocks a CORS response and checks the Sentry tag

Impacted Files:

  • src/config/axios.config.ts

Acceptance Criteria

  • CORS failures appear in Sentry under a unique cors_failure tag
  • Generic network errors continue to use existing error handling
  • Test confirms correct categorisation

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programsecuritySecurity vulnerability or concern

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions