Skip to content

ApiError::internal leaks full error details to API consumers #628

@hman38705

Description

@hman38705

File: services/api/src/handlers.rs

pub fn internal(err: anyhow::Error) -> Self {
    Self {
        code: "INTERNAL_ERROR",
        message: err.to_string(), // full error chain exposed
        ...
    }
}

The full anyhow error chain — which can include database query text, file paths, or stack context — is serialised directly into the JSON response body. This exposes implementation details that could aid an attacker and violates the principle of not leaking internal state to clients.

Expected: Log the full error server-side (already done via tracing) and return a generic message such as "An internal error occurred." to the caller.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions