Skip to content

Commit 9dc1aba

Browse files
authored
Document security considerations in the cargo-cyclonedx README
Signed-off-by: Sergey "Shnatsel" Davidoff <[email protected]>
1 parent ab5d4d7 commit 9dc1aba

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cargo-cyclonedx/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ By contrast, `cargo cyclonedx` sources data both from `Cargo.lock` and from [`ca
102102
- Omit dev-dependencies, which cannot affect the final executable
103103
- Record additional fields such as the license for every component
104104

105+
## Security considerations
106+
107+
`cargo-cyclonedx` calls into Cargo internally to get information about a Rust project. Like nearly any other build system,
108+
Cargo [may run arbitrary code](https://shnatsel.medium.com/do-not-run-any-cargo-commands-on-untrusted-projects-4c31c89a78d6)
109+
when invoked on an untrusted project, so `cargo-cyclonedx` should not be called on untrusted projects either.
110+
111+
Some of the other tools for generating CycloneDX SBOMs do not invoke Cargo and only parse the `Cargo.lock` file.
112+
However, the only way to generate the `Cargo.lock` file for them to scan is to invoke Cargo, so this issue is currently unavoidable for any tool that describes a Cargo project.
113+
105114
## Contributing
106115

107116
See [CONTRIBUTING](../CONTRIBUTING.md) for details.

0 commit comments

Comments
 (0)