How do I remove privacy information from the rodata section of an executable?

Hello:

In the Rust generated executable, I used the strings command to find a large number of strings containing my user name and project path information in the rodata section of the executable, and I've been scouring the web for posts but can't find a solution. How can I remove this information completely?

The relevant configuration information is as follows:
[profile.release]
codegen-units = 1
debug = false
lto = true
opt-level = "z"
panic = "abort"

These paths are likely mostly from panic messages. The best way to avoid including private information is to build your binaries in an environment that doesn't contain any, for example a build container used specifically for this purpose. If you want to go further and hide the names of the crates you've used, I'm not sure how to do that.

2 Likes

the rust compiler does currently embed all kinds of information about the environment, including full paths
this topic reminds me of this one, where they tried to minimize the amount of information leaking in the interest of generating the same executables in different places: Testing out reproducible builds

yess this is the best practical suggestion I think

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.