Skip to content

fix: redact any credentials from https?:// URLs - #1155

Merged
jkowalleck merged 1 commit into
CycloneDX:mainfrom
bardrop-oss:fix-redact-single-token
Nov 26, 2026
Merged

jkowalleck merged 1 commit into
CycloneDX:mainfrom
bardrop-oss:fix-redact-single-token

Conversation

@bardrop

@bardrop bardrop commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Description

redact_auth_from_url() only matched user:password@, so a token without a colon stayed in URLs, PURLs and descriptions.

In http:// and https:// URLs the whole userinfo is dropped now. This includes token:@, :token@ and passwords with an @, which were not (or only partly) dropped before. Other schemes work as before, so ssh://git@... is kept.

As with user:password@ already, ${ENV_VAR} placeholders in the userinfo are dropped too.

Tests are in tests/unit/test_utils_secret.py; 8 of the 19 cases fail without the change. The requirements, poetry and pipenv integration tests pass on Python 3.12 with no snapshot changes.

Resolves or fixes issue: #1150

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: Claude Code
    • LLMs and versions: Claude Opus 5.5
    • Prompts: Fix an open, unclaimed "help wanted" issue following the repo's contribution rules, with tests that fail before and pass after

Affirmation

Signed-off-by: Mradul Singh <msingh@dealmeridian.com>
@bardrop
bardrop requested a review from a team as a code owner November 25, 2026 19:05
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity ✅ 0 (≤ 20 complexity)
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@jkowalleck jkowalleck linked an issue Nov 26, 2026 that may be closed by this pull request
1 of 2 tasks
@jkowalleck jkowalleck changed the title fix: redact single-token credentials from URLs fix: redact single-token credentials from https?:// URLs Nov 26, 2026
@jkowalleck jkowalleck changed the title fix: redact single-token credentials from https?:// URLs fix: redact any credentials from https?:// URLs Nov 26, 2026
@jkowalleck
jkowalleck merged commit bfd3142 into CycloneDX:main Nov 26, 2026
37 checks passed
@jkowalleck jkowalleck added the bug Something isn't working label Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Single-token URL credentials without a colon are not stripped from SBOM URLs

2 participants