Skip to content

Docs: Add the jQuery Core threat model - #152

Open
timmywil wants to merge 1 commit into
mainfrom
threat-model
Open

timmywil wants to merge 1 commit into
mainfrom
threat-model

Conversation

@timmywil

@timmywil timmywil commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Adds a threat model for jQuery core as a page at /threat-model/. It is maintainer-facing reference material that the security policy (jquery/jquery#5925) and the team's internal incident response runbook link to, and it is meant to be revisited after every CVE and at every major version.

  • STRIDE analysis of the HTML-accepting API surface, jQuery.extend, the Ajax subsystem, the build and publish pipeline, and the report intake surface (maintainer attention as an asset).
  • Treats "a library can make already-sanitized input unsafe again", the CVE-2020-11022 and CVE-2020-11023 class, as a first-class failure mode rather than an edge case.
  • Mitigations, risk ranking, and an appendix of the historical CVEs the model draws on.

The page uses Markdown tables and a fenced ASCII diagram. No other page on the site uses tables today, so the rendered output is worth a look in preview.

- STRIDE-based threat model for jQuery core, built from a library-focused template
- Covers the HTML pipeline, jQuery.extend, Ajax, the build and publish pipeline, and the report intake surface
- Treats "a library can make sanitized input unsafe again" (CVE-2020-11022/11023) as a first-class failure mode
- Published at /threat-model/ so SECURITY.md and the internal runbook can link to it
@timmywil
timmywil requested review from gibson042 and mgol October 15, 2026 16:44
Comment thread pages/threat-model.md
Comment on lines +41 to +73
┌──────────────────────────────────────────────────────────┐
│ Caller Application │
│ │
│ (developer code — may or may not sanitize before passing)│
└─────────────────────────┬────────────────────────────────┘
│ HTML strings, objects, URLs,
│ AJAX options, selectors
▼
══════════════════════ TRUST BOUNDARY ══════════════════════
(jQuery implicitly trusts its caller;
the caller implicitly trusts jQuery's output)
│
┌─────────────────────────▼────────────────────────────────┐
│ jQuery │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌─────────────────┐ │
│ │ DOM / HTML │ │ Object utils │ │ Ajax / JSONP │ │
│ │ pipeline │ │ (extend) │ │ │ │
│ │ (htmlPrefilter│ │ │ │ │ │
│ │ buildFrag., │ └──────────────┘ └─────────────────┘ │
│ │ selector) │ │
│ └──────┬───────┘ │
└──────────┼────────────────────────────────────────────────┘
│ │ │
══════════ TRUST BOUNDARY ═══════════════════════════════════
│ │ │
▼ ▼ ▼
┌─────────┐ ┌──────────┐ ┌───────────┐
│ DOM │ │ Host page│ │ Network │
│ (script │ │ globals │ │ (remote │
│execution│ │(Object. │ │ servers, │
│context) │ │prototype)│ │ CDN) │
└─────────┘ └──────────┘ └───────────┘

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

monospace alignment:

Suggested change
┌──────────────────────────────────────────────────────────┐
│ Caller Application │
│ │
│ (developer code — may or may not sanitize before passing)│
└─────────────────────────┬────────────────────────────────┘
│ HTML strings, objects, URLs,
│ AJAX options, selectors
▼
══════════════════════ TRUST BOUNDARY ══════════════════════
(jQuery implicitly trusts its caller;
the caller implicitly trusts jQuery's output)
│
┌─────────────────────────▼────────────────────────────────┐
│ jQuery │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌─────────────────┐ │
│ │ DOM / HTML │ │ Object utils │ │ Ajax / JSONP │ │
│ │ pipeline │ │ (extend) │ │ │ │
│ │ (htmlPrefilter│ │ │ │ │ │
│ │ buildFrag., │ └──────────────┘ └─────────────────┘ │
│ │ selector) │ │
│ └──────┬───────┘ │
└──────────┼────────────────────────────────────────────────┘
│ │ │
══════════ TRUST BOUNDARY ═══════════════════════════════════
│ │ │
▼ ▼ ▼
┌─────────┐ ┌──────────┐ ┌───────────┐
│ DOM │ │ Host page│ │ Network │
│ (script │ │ globals │ │ (remote │
│execution│ │(Object. │ │ servers, │
│context) │ │prototype)│ │ CDN) │
└─────────┘ └──────────┘ └───────────┘
┌──────────────────────────────────────────────────────────┐
│ Caller Application │
│ │
│ (developer code — may or may not sanitize before passing)│
└─────────────────────────┬────────────────────────────────┘
│ HTML strings, objects, URLs,
│ AJAX options, selectors
▼
══════════════════════ TRUST BOUNDARY ══════════════════════
(jQuery implicitly trusts its caller;
the caller implicitly trusts jQuery's output)
│
┌─────────────────────────▼────────────────────────────────┐
│ jQuery │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌────────────────┐ │
│ │ DOM / HTML │ │ Object utils │ │ Ajax / JSONP │ │
│ │ pipeline │ │ (extend) │ │ │ │
│ │(htmlPrefilter│ │ │ │ │ │
│ │ buildFrag., │ └───────┬──────┘ └───────┬────────┘ │
│ │ selector) │ │ │ │
│ └──────┬───────┘ │ │ │
└─────────┼──────────────────┼─────────────────┼───────────┘
│ │ │
══════════╪═ TRUST BOUNDARY ═╪═════════════════╪════════════
│ │ │
▼ ▼ ▼
┌─────────┐ ┌──────────┐ ┌───────────┐
│ DOM │ │ Host page│ │ Network │
│ (script │ │ globals │ │ (remote │
│execution│ │(Object. │ │ servers, │
│context) │ │prototype)│ │ CDN) │
└─────────┘ └──────────┘ └───────────┘

Comment thread pages/threat-model.md

> "jQuery doesn't sanitize user input, so it shouldn't have security issues, right? Not really — an issue we fixed in 3.5.0 was a case where the user has already sanitized HTML before passing it to jQuery, and then jQuery was transforming it to one that could still run an embedded script."

In other words: **a library can re-introduce vulnerabilities into input that was already safe.** Mutation, normalization, and "helpful" rewriting are all places where this happens. This isn't hypothetical for jQuery — CVE-2020-11022 and CVE-2020-11023 are exactly that failure mode. The threat model below treats "making sanitized input unsafe again" as a first-class threat category, not an afterthought.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should the CVE identifiers be hyperlinks, here and/or in the appendix?

@UlisesGascon

Copy link
Copy Markdown
Member

Hey @timmywil! I started to work on proposal for a threat model (as discussed on slack) but I didn't had just yet time to formalize it... so I landed this commit on my fork (ref) in case that helps a bit with the design and the format.

I mostly followed the style and format from other threat models we have in place for Node.js, Lodash, moment, webpack... I am happy to prepare a proposal if you like the format.

Our goal with the threat model in those projects is overall to reduce the noise (see: Why Most Lodash Vulnerability Reports Get Rejected), simplify triage (see: Maintainer's Guide to GHSAs - Editorial criteria) and to clarify for developers what they need to be worried when using our software to build things.

As a runbook for the team most of the time we use incident response plans like this one for Express where we have all the steps to follow when there are new reports or security incidents within the project.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants