GCC optimization can hide file paths from binary security scans
A technical analysis shows that GCC 12 and later, when targeting x86-64, can split string constants like embedded file paths into overlapping 16-byte chunks to use vectorized SIMD move instructions when constructing a std::string. As a result, tools like grep or GNU binutils' strings, which look for contiguous byte sequences, fail to detect the original path even though it is reconstructed and printed correctly at runtime.
GoKawiil's interpretation of the reporting above, not reported fact.
Many Linux distributions and package managers rely on scanning built binaries for absolute build-machine paths to catch relocation bugs before software ships to end users. This finding suggests such audits could give false assurances, since a path may still be functionally embedded in a binary while remaining invisible to standard string-scanning tools. It points to a gap between how compilers represent data internally and how security or packaging tools assume that data is stored.
- GCC can split embedded string constants into 16-byte chunks for SIMD-optimized std::string construction.
- This optimization can defeat standard binary auditing tools like grep and strings that search for contiguous paths.
- Distribution maintainers relying on simple string scans for build-path leaks may need more robust detection methods.
Source: stoppels.ch, 2026-11-12
Published there as: “Paths in Pieces”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.