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

fix(sbom): fix infinite loop for cyclonedx #3998

Merged

Conversation

DmitriyLewen
Copy link
Contributor

Description

when dependencies are cyclically dependent on each other.
e.g.:

➜  docker run -it --rm ubuntu 

root@0a467f393ce3:/# cat /var/lib/dpkg/status | grep "Package: libc6" -A 11
Package: libc6
...
Version: 2.35-0ubuntu3.1
Replaces: libc6-amd64
Depends: libgcc-s1, libcrypt1 (>= 1:4.4.10-10ubuntu4)

root@0a467f393ce3:/# cat /var/lib/dpkg/status | grep "Package: libcrypt1" -A 12
Package: libcrypt1
...
Version: 1:4.4.27-1
Replaces: libc6 (<< 2.29-4)
Depends: libc6 (>= 2.25)

libc6 => libcrypt1 and libcrypt1 => libc6.

For these cases Trivy gets infinity loops when trying to unmarshal cyclonedx file.

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@knqyf263 knqyf263 merged commit c8283ce into aquasecurity:main Apr 9, 2023
@DmitriyLewen DmitriyLewen deleted the fix/infinite-loop-cyclonedx branch April 10, 2023 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

goroutine stack exceeds 1000000000-byte limit - trivy sbom 0.39.0
2 participants