Skip to content

Security: Unpinned CDN dependency versions allow supply chain attacks#635

Open
barttran2k wants to merge 1 commit intooffa:masterfrom
barttran2k:contribai/fix/security/unpinned-cdn-dependency-versions-allow-s
Open

Security: Unpinned CDN dependency versions allow supply chain attacks#635
barttran2k wants to merge 1 commit intooffa:masterfrom
barttran2k:contribai/fix/security/unpinned-cdn-dependency-versions-allow-s

Conversation

@barttran2k
Copy link
Copy Markdown
Contributor

Problem

The marked and marked-gfm-heading-id libraries are loaded from jsdelivr without pinned versions (/npm/marked/marked.min.js and /npm/marked-gfm-heading-id/lib/index.umd.js). This means the CDN serves whatever the latest version is, which could change at any time. A malicious version published to npm would be automatically served to all visitors.

Severity: medium
File: index.html

Solution

Pin both libraries to specific versions, e.g., https://cdn.jsdelivr.net/npm/marked@12.0.0/marked.min.js and add SRI hashes.

Changes

  • index.html (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The `marked` and `marked-gfm-heading-id` libraries are loaded from jsdelivr without pinned versions (`/npm/marked/marked.min.js` and `/npm/marked-gfm-heading-id/lib/index.umd.js`). This means the CDN serves whatever the latest version is, which could change at any time. A malicious version published to npm would be automatically served to all visitors.

Affected files: index.html

Signed-off-by: Trần Bách <45133811+barttran2k@users.noreply.github.com>
Copy link
Copy Markdown
Owner

@offa offa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's different to the #625 PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants