Skip to content

[Bug] axios.config.ts error response data logged without sanitizing sensitive fields #792

Description

@RUKAYAT-CODER

Overview

axios.config.ts logs the full error.response.data object to the console and Sentry. If the response contains passwords, tokens, or PII in error payloads (as some backends inadvertently include), these are logged in plaintext.

Specifications

Features:

  • Define a sanitizeErrorResponse(data: unknown): unknown function that strips sensitive keys
  • Apply it before all error logging

Tasks:

  • Implement sanitization for keys: password, token, secret, card, cvv, ssn
  • Apply to both console and Sentry logging
  • Write tests for sanitization of nested objects

Impacted Files:

  • src/config/axios.config.ts
  • src/utils/sanitize.ts (new)

Acceptance Criteria

  • Sensitive keys are replaced with [REDACTED] before logging
  • Nested objects are recursively sanitized
  • Unit tests cover all sensitive key names

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingsecuritySecurity vulnerability or concern

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions