Skip to content

containsCredentials misses credentials in subsequent JSON values #2217

Closed

Description

@TanvirTian

What happened in your environment?

containsCredentials only checks the first JSON value in a response body. If a credential appears in a subsequent JSON value, it is not detected and the response may be printed in debug traces.

What did you expect to happen?

The entire response should be checked for credentials before being printed.

How can we reproduce it?

    1. Pass the following response body to containsCredentials:
{"status":"ok"}{"access_token":"12345"}
    1. containsCredentials returns false because it only decodes the first JSON value.

This causes logResponseBody to print the response body instead of redacting it, exposing the access_token in the debug trace

What is the version of your ORAS CLI?

1.34

What is your OS environment?

CachyOS (x86_64)

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Activity

  1. added
    bug
    triage
    on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugtriage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions