Skip to content

[Security][Medium] Encode user-supplied IDs in API path segments #82

@eranchetz

Description

@eranchetz

Summary

Some tool handlers interpolate user-controlled id values directly into URL path segments without encodeURIComponent, enabling path/query manipulation.

Affected code

  • src/tools/cloudIncidents.ts:213 (.../cloudincidents/${id})
  • src/tools/anomalies.ts:206 (.../anomalies/v1/${id})

Impact

IDs containing reserved characters (/, ?, #, %) can alter the requested path/query and hit unintended endpoints under api.doit.com.

Recommended fix

  • Change to .../${encodeURIComponent(id)} for all user-provided path segments.

Acceptance criteria

  • All untrusted path segments encoded.
  • Tests cover IDs containing reserved characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions