Disabled certificate validation in curl calls in build scripts
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- High
- Impact type
- Spoofing, Code execution
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · GHSA-wvg9-7q49-c7mg. Fix status from GitHub. Impact type from CWE-295 and CWE-829.
Summary
Provisioning Scripts in the agent build environment from 4.1.3 before 4.14.0 call curl with the -k or --insecure flag, which disables SSL/TLS certificate validation. An attacker with network access in a man-in-the-middle position can intercept downloads of build dependencies and source code and serve malicious content, which can lead to arbitrary code execution during package builds. The flaw is CWE-295 Improper Certificate Validation.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
### Summary The use of `curl` with the `-k` (or `--insecure`) flag disables SSL/TLS certificate validation, allowing potential Man-In-The-Middle (MITM) attacks. This can lead to arbitrary code execution or the download of malicious dependencies during package building. The risk is especially severe because these scripts and Dockerfiles fetch critical build dependencies and source code over HTTPS, trusting the integrity of the content without validation. ### Details The following files use `curl -k` or equivalent insecure options, bypassing SSL/TLS certificate validation: - [`packages/debs/amd64/agent/Dockerfile`](https://github.com/wazuh/wazuh/blob/1614de88caa001a91124ce3d4d962fe19a4db7c5/packages/debs/amd64/agent/Dockerfile): ```dockerfile RUN curl -k https://curl.se/ca/cacert.pem -o /etc/ssl/certs/ca-certificates.crt ``` - [`packages/aix/generate_wazuh_packages.sh`](https://github.com/wazuh/wazuh/blob/1614de88caa001a91124ce3d4d962fe19a4db7c5/packages/aix/generate_wazuh_packages.sh): ```shell curl -LO http://www.cpan.org/src/5.0/perl-5.10.1.tar.gz -k -s ... rm -f wazuh.tar.gz && curl -L ${source_code} -k -o wazuh.tar.gz -s ... short_commit_hash=$(curl -ks "https://api.github.com/repos/wazuh/wazuh/commits/${reference}" | ...) ``` - [`packages/hp-ux/generate_wazuh_packages.sh`](https://github.com/wazuh/wazuh/blob/1614de88caa001a91124ce3d4d962fe19a4db7c5/packages/hp-ux/generate_wazuh_packages.sh): ```shell curl -k -SO http://packages.wazuh.com/utils/gcc/gcc_9.4_HPUX_build.tar.gz ... curl -k -SO http://packages.wazuh.com/utils/cmake/cmake_3.22.2_HPUX_build.tar.gz ... /usr/local/bin/curl -k -L -o "/wazuh.zip" "https://github.com/wazuh/wazuh/archive/${wazuh_branch}.zip" ... short_commit_hash=$(/usr/local/bin/curl -ks "https://api.github.com/repos/wazuh/wazuh/commits/${wazuh_branch}" | ...) ``` - [`packages/rpms/i386/legacy/Dockerfile`](https://github.com/wazuh/wazuh/blob/1614de88caa001a91124ce3d4d962fe19a4db7c5/packages/rpms/i386/legacy/Dockerfile): ```dockerfile RUN rm -f /etc/pki/tls/certs/ca-bundle.crt && curl -k -o /etc/pki/tls/certs/ca-bundle.crt https://curl.se/ca/cacert.pem ``` **Problem:** Using `-k` disables SSL/TLS certificate validation, making the connection vulnerable to MITM attacks. An attacker with network access could intercept and modify the downloaded files, potentially injecting malicious code or altering the build artifacts. ### PoC **High-level steps:** 1. Set up a transparent proxy or use ARP spoofing on the build network. 2. Intercept HTTPS requests to the affected URLs (e.g., `https://curl.se/ca/cacert.pem`). 3. Serve a malicious file in response. 4. The build system will download and use the malicious content without any certificate validation or warning. **Result:** The attacker can inject arbitrary code or modify dependencies, leading to remote code execution or supply chain compromise. ### Impact - **Type:** Supply chain attack, remote code execution, package integrity compromise. - **Who is impacted:** Anyone building or using packages created from these scripts/Dockerfiles, including downstream users. - **Severity:** High. Attackers can inject arbitrary code during the build process, potentially compromising all users of the built packages. **Recommendation:** Remove all uses of the `-k`/`--insecure` flag from `curl` invocations. Ensure all downloads are performed with strict certificate validation to maintain the integrity and security of build dependencies. ### Fix - https://github.com/wazuh/wazuh/pull/32046 - https://github.com/wazuh/wazuh/pull/32047 ### Credit - This vulnerability was uncovered by tooling by [Socket](https://socket.dev/) - This vulnerability was reported by @JLLeitschuh at Socket
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | Provisioning Scripts (agent build environment) | >=4.1.3 | >=4.14.0 | Patch available | GHSA-wvg9-7q49-c7mg |
- Provisioning Scripts (agent build environment) Vendor— Affected >=4.1.3 Fixed in >=4.14.0 Patch available GHSA-wvg9-7q49-c7mg
Remediation
Update Provisioning Scripts to version 4.14.0 or later, which fixes the flaw.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-wvg9-7q49-c7mg Provisioning Scripts (agent build environment) Fixed in >=4.14.0 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-wvg9-7q49-c7mg
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences