T08 · Insecure Dependencies
Error
- Location
- claw.json:18
- Finding
- Unpinned External Dependencies Execute Security-Critical Code<![CDATA[ ## Vulnerability Details **File Location**: `claw.json:18-21`, `scripts/suite.py:18-26` **Vulnerability Type**: Supply-chain risk from unpinned executable dependencies **Risk Level**: High ### Vulnerable Code ```json "dependencies": [ "neckr0ik-security-scanner", "neckr0ik-security-fixer" ] ``` ```python # Import sibling modules sys.path.insert(0, str(Path(__file__).parent.parent / "neckr0ik-security-scanner" / "scripts")) sys.path.insert(0, str(Path(__file__).parent.parent / "neckr0ik-security-fixer" / "scripts")) try: from audit import audit_skill, Severity, Vulnerability from fixer import Fixer except ImportError: # If modules not available, use standalone pass ``` ### Technical Analysis The project delegates its scanning and automatic file-remediation operations to two dependencies that have no declared version or integrity constraint. Their source code is not included in the audited project, so their effective behavior cannot be verified from this package. The script also prepends dependency-controlled directories to `sys.path` and then imports generic module names, `audit` and `fixer`. Python executes top-level module code during import. Consequently, any malicious or compromised module resolved from these directories runs with the same operating-system permissions as the suite. The generic imports also increase module-resolution ambiguity. The implementation does not verify that the imported modules originated from an expected, trusted file before executing them. ### Attack Path 1. An attacker compromises one of the named dependency packages, introduces a malicious future version, or causes an attacker-controlled dependency directory to be installed at the expected sibling path. 2. The package manager resolves the dependency without an exact version or integrity hash. 3. The user invokes `scripts/suite.py`. 4. The script places the dependency's `scripts` directory at the front of `sys.path`. 5. Python imports and ex ...[truncated 710 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin both dependencies to exact, reviewed versions rather than resolving unconstrained releases. 2. Require cryptographic integrity verification through hashes, signed packages, or a trusted lockfile. 3. Audit the complete source of each dependency before permitting it to scan or modify repositories. 4. Replace `sys.path` manipulation and generic imports with normal package-qualified imports. 5. Verify imported module origins against approved installation paths before using them. 6. Run scanner and fixer dependencies with least privilege in an isolated environment that exposes only the target directory. 7. Separate scanning from modification and require explicit review before applying dependency-generated fixes. 8. Add continuous dependency monitoring and a documented update-review process. ]]>
