T08 · Insecure Dependencies
- Location
SKILL.md:235- Finding
Unpinned Third-Party Packages and CI Actions May Execute Untrusted Code
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 235–256
Vulnerability Type: Supply-chain exposure through unpinned dependencies and dynamically resolved tooling
Risk Level: MediumVulnerable Code
markdown - **axe-core** — industry standard, lowest false positives ```bash # In Playwright/Cypress npm install @axe-core/playwright # or @axe-core/cypress # In CI npm install @axe-core/cli axe https://your-site.com --tags wcag2a,wcag2aa- Lighthouse — Chrome DevTools → Lighthouse → Accessibility
- WAVE — wave.webaim.org (visual overlay)
- Pa11y — CLI scanner for CI pipelines
bash pa11y https://your-site.com --standard WCAG2AA
CI pipeline integration:
yaml # GitHub Actions example a11y-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: npm ci && npm run build - run: npx pa11y-ci --config .pa11yci.json - run: npx playwright test --grep @a11ytext ### Technical Analysis The guidance installs npm packages without exact version constraints and invokes command-line packages through `npx` without requiring a prior, lockfile-controlled installation. If a requested executable is unavailable locally, `npx` may resolve, download, and immediately execute a package from the configured npm registry. The GitHub Actions example also references `actions/checkout@v4`, a mutable major-version tag, rather than an audited full commit SHA. Although this is a common configuration, it does not provide immutable provenance. Package installation and GitHub Actions both execute upstream-controlled code. Consequently, compromise of a referenced package, its transitive dependencies, a registry account, or a mutable action reference could turn these otherwise legitimate instructions into a supply-chain execution channel. The audit did not identify an intentionally malicious or typosquatted dependency; the risk arises from unsafe version resolution and execution practice ...[truncated 1555 chars]- Remediation
View remediation
Remediation Suggestions
-
Pin npm packages to reviewed exact versions rather than unconstrained latest releases:
bash npm install --save-dev @axe-core/playwright@<reviewed-version> npm install --save-dev @axe-core/cli@<reviewed-version> npm install --save-dev pa11y-ci@<reviewed-version> npm install --save-dev @playwright/test@<reviewed-version> -
Commit and review the package lockfile. In CI, retain
npm ciso dependency resolution follows the lockfile and fails when it is inconsistent withpackage.json. -
Install all required CLI tools explicitly, then prevent
npxfrom downloading missing packages at execution time:bash npx --no-install pa11y-ci --config .pa11yci.json npx --no-install playwright test --grep @a11y -
Pin GitHub Actions to audited full commit SHAs, optionally retaining the release tag in a comment for maintainability:
yaml - uses: actions/checkout@<audited-full-commit-sha> # v4.x.x -
Enable dependency update and vulnerability-monitoring automation. Require review of lockfile changes, package provenance, lifecycle scripts, maintainers, and transitive dependency changes before merging updates.
-
Harden CI with explicit least-privilege
permissions, avoid exposing secrets to workflows triggered by untrusted forks, and use isolated ephemeral runners where feasible. -
Consider disabling unnecessary npm lifecycle scripts during installation and allowing them only for dependencies that have been reviewed and require them.
-
