Skip to content

Security: Sensitive response data may be exposed through exception messages#526

Open
tomaioo wants to merge 1 commit intookta:masterfrom
tomaioo:fix/security/sensitive-response-data-may-be-exposed-t
Open

Security: Sensitive response data may be exposed through exception messages#526
tomaioo wants to merge 1 commit intookta:masterfrom
tomaioo:fix/security/sensitive-response-data-may-be-exposed-t

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 15, 2026

Summary

Security: Sensitive response data may be exposed through exception messages

Problem

Severity: Medium | File: okta/errors/http_error.py:L20

The SDK embeds raw server response content directly into exception messages (HTTPError.message includes response_body, and OktaAPIError.message includes server-provided summaries/causes). If these exceptions are logged or surfaced to clients, they can leak sensitive details such as tokens, identifiers, internal error context, or PII returned by upstream services.

Solution

Avoid including full raw response bodies in exception strings. Redact sensitive fields (e.g., tokens, secrets, user identifiers), truncate long payloads, and store full response details only in structured/internal debug fields guarded by secure logging controls.

Changes

  • okta/errors/http_error.py (modified)

The SDK embeds raw server response content directly into exception messages (`HTTPError.message` includes `response_body`, and `OktaAPIError.message` includes server-provided summaries/causes). If these exceptions are logged or surfaced to clients, they can leak sensitive details such as tokens, identifiers, internal error context, or PII returned by upstream services.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant