T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:18
- Finding
- Unpinned Remote Executable Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:18-23`, `SKILL.md:73-79`, `SKILL.md:125-133`, and `SKILL.md:160-166` **Vulnerability Type**: Unpinned third-party browser dependencies and mutable CDN-hosted executable code **Risk Level**: Medium ### Vulnerable Code Snippets `SKILL.md:18-23`: ```markdown browser without a build step, or asks about module-tsx. It transpiles code on the fly and rewrites bare specifiers (like `"react"`) to `https://esm.sh/<pkg>` automatically. ## How to load it ```html <script type="module" src="https://esm.sh/module-tsx"></script> ``` ``` `SKILL.md:73-79`: ```html <script type="module" src="https://esm.sh/module-tsx"></script> ... <script type="module-tsx"> import { createRoot } from "react-dom/client"; import "@tailwindcss/browser"; ``` `SKILL.md:125-133`: ```html <script type="importmap"> { "imports": { "react": "https://esm.sh/react@18", "react-dom": "https://esm.sh/react-dom@18", "react-dom/": "https://esm.sh/react-dom@18/", "@radix-ui/themes": "https://esm.sh/@radix-ui/themes?deps=react@18,react-dom@18", "@radix-ui/themes/": "https://esm.sh/@radix-ui/themes/" } } </script> <script type="module" src="https://esm.sh/module-tsx"></script> ``` `SKILL.md:160-166`: ```html <script type="module" src="https://esm.sh/module-tsx/dev"></script> ``` ```html <script type="module" src="https://esm.sh/module-tsx"></script> ``` ### Technical Analysis The skill directs generated pages to execute JavaScript modules obtained from `esm.sh`. The primary `module-tsx` runtime is loaded without an exact version, and its automatic bare-specifier rewriting can resolve additional unpinned packages. The example import of `@tailwindcss/browser` is likewise unpinned. Some import-map entries use only the React major version, while the Radix UI entries specify no package version at all. These mutable dependency references prevent consumers from determining that the code executed in p ...[truncated 1992 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin every remotely loaded package to an exact reviewed version rather than an unversioned or major-only reference. This includes `module-tsx`, React, React DOM, Tailwind Browser, and Radix UI. 2. Prefer immutable artifact URLs or content-addressed assets so previously reviewed content cannot change without a source update. 3. Apply Subresource Integrity to cross-origin scripts when the CDN and loading mechanism support stable integrity metadata. 4. For production deployments, self-host audited runtime and dependency artifacts instead of resolving mutable packages dynamically. 5. Avoid automatic production resolution of arbitrary bare specifiers. Define an explicit import map containing every approved dependency and exact version. 6. Generate and retain a dependency lockfile or manifest, including transitive dependency versions, as part of the review and deployment process. 7. Enforce a restrictive Content Security Policy that limits `script-src`, `connect-src`, and other relevant directives to required origins. 8. Establish dependency monitoring and a controlled update process so version changes are reviewed, tested, and deployed intentionally. 9. Document that the development CDN loader is suitable only for trusted development environments unless the remote artifacts are pinned and verified. ]]>
