Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated SBOM contains access token #581

Open
mbleichner opened this issue Feb 3, 2025 · 3 comments
Open

Generated SBOM contains access token #581

mbleichner opened this issue Feb 3, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@mbleichner
Copy link

mbleichner commented Feb 3, 2025

Describe the bug

When executed from a git repo, the plugin writes the value of git remote get-url origin into the generated SBOM. In case of a Gitlab-CI build, this URL contains an access token, e.g. https://gitlab-ci-token:[email protected]/group-name/repo-name.git.

Although this token has a very limited lifespan, it could in theory allow a short attack window if some process can access the generated SBOM file.

Also it triggers a warning in the secret detection scanner.

To Reproduce

Execute the plugin via Gitlab-CI job

Expected behavior

Access tokens should be removed from the output. Alternatively, the inclusion of the git URL should be optional.

Environment (please complete the following information):

  • OS: Linux
  • Gradle version: 8.12.1
  • CycloneDX Plugin version: 2.0.0
@mbleichner mbleichner added the bug Something isn't working label Feb 3, 2025
@skhokhlov
Copy link
Member

It is possible to disable VCS resolution by setting it manually in build.gradle file:

cyclonedxBom {
    setVCSGit { vcs ->
        vcs.url = ""
    }
}

@mbleichner
Copy link
Author

Thanks. Somehow I must have missed this part in the docs.

But the question still stands - shouldn't it be the default to remove any credentials from the URL? If you disagree, feel free to close this issue.

@skhokhlov
Copy link
Member

It must be fixed, probably by removing username and password from VCS URI.

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

No branches or pull requests

2 participants