Buildroot BR_NO_CHECK_HASH_FOR data integrity vulnerability
Buildroot's hash-checking can be bypassed when a package is listed in BR_NO_CHECK_HASH_FOR, allowing a man-in-the-middle attacker to serve a malicious source archive over HTTP that is not integrity-checked. This can lead to arbitrary command execution in the builder.
Originally disclosed on Cisco Talos
A data integrity vulnerability exists in the BRNOCHECKHASHFOR functionality of Buildroot 2023.08.1 and dev commit 622698d7847. A specially crafted man-in-the-middle attack can lead to arbitrary command execution in the builder.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the BR_NO_CHECK_HASH_FOR mechanism allows skipping hash verification for packages, and the fallback download over plain HTTP does not enforce integrity checks, so a network attacker can substitute a malicious archive.
Impact
An attacker could execute arbitrary commands in the builder and tamper with any file generated for Buildroot's targets and hosts.
What the attacker needed
Man-in-the-middle network position; Buildroot configured with a package in BR_NO_CHECK_HASH_FOR; ability to drop connections to the primary source
The fix
The vendor released a patch, but the text does not describe the fix details.
How it was found
- Configure Buildroot with a custom Linux kernel git repository and enable the latest version option.
- The attacker drops connections to the custom repository, causing the download to fall back to the backup site over HTTP.
- The attacker serves a malicious tar.gz file from the backup site.
- Buildroot downloads the file without hash verification and uses it in the build, executing injected commands.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Buildroot is a tool that builds Linux systems for embedded devices. It downloads source code from the internet and normally checks a fingerprint (hash) to make sure the files are genuine. Here, a setting that skips that check for certain packages let an attacker who can intercept network traffic replace the download with a malicious file, and because build files can run commands, the attacker could run their own commands on the build machine.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.