-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Cargo registry paths are leaked in compiled binary #75799
Comments
I ran |
I was looking at this same problem yesterday. I can confirm stripping (either with |
I have just found (thanks to folks on IRC) there's a
|
|
There's also this: Remove panic string formatting, but it requires Xargo. |
@danielhuang yes, I'm aware this does not solve the problem entirely and has the problems you mentioned. My comment was more of a workaround to solve part of the problem. |
Given that there are quite many ways to eventually have Can you elaborate what exactly you expect the behaviour to be? |
I want to remove all debug-related information from the binary when compiling in release mode. |
Could someone label this |
Duplicate of #40552. |
+1 |
Yep, Rust is "memory-safe" language, but is not "developer-safe" language. In some highly sensitive projects, registry paths leaked in binary can cause a lot of problems. Because the registry path contains the developer's user name. |
When compiling a rust program, and inspecting the resulting binary, I can see paths of the form
$HOME/.cargo/registry/...
embedded inside.Steps to reproduce:
cargo init --bin
regex = "1"
cargo build --release
strings target/release/<name> | grep registry
to inspect the binary.Note that the crate and code example is completely arbitrary — the same behavior occurs with any combination of crates.
Software versions:
The text was updated successfully, but these errors were encountered: