Skip to content

Commit a7f2313

Browse files
david-a-wheeler06kellyjacljharb
authored
Provide recommendation to counter xz utils style attack (#560)
* Provide recommendation to counter xz utils style attack The malicious attack on the xz utils slipped through many defenses because the "source" package included pre-generated malicious code. This meant that review of the source code (e.g., as seen by git) couldn't find the problem. This proposes a best practices to counter it. The text is longer than I'd like, but it's hard to make it short, and this was a worrying attack so I think it's reasonable to say this. We'll probably need to renumber this proposal if we also add the proposed text to counter attacks like polyfill.io: #559 ... but I think that's okay! Signed-off-by: David A. Wheeler <[email protected]> * Fix grammar nit in xz utils response Signed-off-by: David A. Wheeler <[email protected]> * Clarify text Signed-off-by: David A. Wheeler <[email protected]> * Fix emphasis for markdownlint Signed-off-by: David A. Wheeler <[email protected]> * Update docs/Concise-Guide-for-Developing-More-Secure-Software.md Co-authored-by: j-k <[email protected]> Signed-off-by: David A. Wheeler <[email protected]> * Clarify source package should only include VCS materials The source package should be a copy or subset of the VCS materials. Signed-off-by: David A. Wheeler <[email protected]> * Update docs/Concise-Guide-for-Developing-More-Secure-Software.md Co-authored-by: Jordan Harband <[email protected]> Signed-off-by: David A. Wheeler <[email protected]> --------- Signed-off-by: David A. Wheeler <[email protected]> Co-authored-by: j-k <[email protected]> Co-authored-by: Jordan Harband <[email protected]>
1 parent 437708f commit a7f2313

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/Concise-Guide-for-Developing-More-Secure-Software.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Here is a concise guide for all software developers for secure software developm
3333
24. **Continuously improve**. Improve scores, look for tips, & apply as appropriate.
3434
25. **Manage succession**. Have clear governance & work to add active, trustworthy maintainer(s).
3535
26. **Prefer memory-safe languages**. Many vulnerabilities involve memory safety. Where practical, use memory-safe programming languages (most are) and keep memory safety enabled. Otherwise, use mechanisms like extra tools and peer review to reduce risk.
36-
27. **Ensure production websites only load assets from your own domains**. _Linking_ to other domains is fine, but where practical, don't directly load assets such as JavaScript, CSS, and media (including images) from domains you do not control. If you do, your site might be subverted if that other domain is subverted, so investigate the risks before doing so. See the [subverted polyfill.io revelation in 2024](https://blog.qualys.com/vulnerabilities-threat-research/2024/06/28/polyfill-io-supply-chain-attack).
36+
27. **If a source code (unbuilt) package is released, it should only include content from the version control system (VCS), and source package users should rebuild, if needed, to create production (built) package(s)**. E.g., if autotools is used, if a source package is released it should _not_ include a generated `configure` file, while recipients should ignore pre-generated files like `configure` and instead rebuild from source (e.g., with `autoreconf`). This eliminates a malware-hiding mechanism, as illustrated by an attack on [xz utils](https://access.redhat.com/security/cve/CVE-2024-3094).
37+
28. **Ensure production websites only load assets from your own domains**. _Linking_ to other domains is fine, but where practical, don't directly load assets such as JavaScript, CSS, and media (including images) from domains you do not control. If you do, your site might be subverted if that other domain is subverted, so investigate the risks before doing so. See the [subverted polyfill.io revelation in 2024](https://blog.qualys.com/vulnerabilities-threat-research/2024/06/28/polyfill-io-supply-chain-attack).
3738

3839
We welcome suggestions and updates! Please open an [issue](https://github.com/ossf/wg-best-practices-os-developers/issues/) or post a [pull request](https://github.com/ossf/wg-best-practices-os-developers/pulls).

0 commit comments

Comments
 (0)