T08 · Insecure Dependencies
Warning
- Location
- references/build-tooling.md:47
- Finding
- Build and CI Templates Use Unpinned Executable Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `references/build-tooling.md`, lines 47-51 and 377-415 **Vulnerability Type**: Supply-chain exposure through mutable or unversioned dependencies **Risk Level**: Medium ### Vulnerable Code ```cmake FetchContent_Declare( fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_TAG 10.1.1 ) ``` ```yaml steps: - uses: actions/checkout@v3 - name: Install dependencies run: | pip install conan conan install . --output-folder=build --build=missing ``` The same mutable `actions/checkout@v3` reference also appears in the sanitizer and static-analysis jobs. ### Technical Analysis The documented build and CI templates retrieve and execute third-party components without cryptographically fixing their contents: - `pip install conan` does not specify an exact package version or verify an artifact hash. - `actions/checkout@v3` is a mutable major-version reference rather than an immutable commit SHA. - `GIT_TAG 10.1.1` identifies a Git tag rather than a full immutable commit SHA. Package installation, GitHub Actions, and CMake `FetchContent` dependencies can execute code in developer or CI environments. If an upstream account, package, release tag, or distribution channel is compromised, the retrieved payload can differ from the content originally reviewed. No evidence indicates that the named dependencies are currently malicious. The vulnerability is the absence of immutable and verifiable dependency resolution in templates likely to be copied into real projects. ### Attack Path 1. A developer adopts the documented CMake or GitHub Actions template. 2. A build or CI job resolves the package, action tag, or Git tag at execution time. 3. An attacker compromises the relevant upstream account or distribution channel, or causes a mutable reference to resolve to altered content. 4. The build system downloads the altered component. ...[truncated 774 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Pin Python dependencies to reviewed, exact versions and install them with verified hashes, preferably through a locked requirements file. - Pin GitHub Actions to full commit SHAs. Use automated dependency tooling to submit reviewed SHA updates. - Pin `FetchContent` Git dependencies to full commit SHAs rather than mutable tags. - Generate and enforce dependency lockfiles where supported. - Restrict CI token permissions with an explicit least-privilege `permissions` block. - Avoid exposing secrets to jobs that download or execute unnecessary third-party components. - Add dependency review, provenance verification, and artifact integrity checks to CI. ]]>
