Skip to content

Release 1.3.0 - #557

Merged
CodeByZach merged 4 commits into
masterfrom
release-1.3.0
Nov 2, 2026
Merged

CodeByZach merged 4 commits into
masterfrom
release-1.3.0

Conversation

@CodeByZach

Copy link
Copy Markdown
Owner

This releases 1.3.0. It fixes a security issue in how pace reads inline options; the advisory, GHSA-5fmc-v4p3-pqpg, is published together with the release.

Commits

  • Security fix:
    • data-pace-options is read only from a <script> element, as the README documents;
    • option merging skips __proto__, constructor and prototype keys, also in nested options;
    • the progress bar is built with DOM methods instead of an HTML string, which also lets pace run on pages that enforce Trusted Types.
    • Tests in tests/security.spec.mjs.
  • style field in package.json, pointing to pace-theme-default.css, so jsDelivr finds the CSS file without guessing.
  • Version from package.json: the build copies the version into the headers of pace.js and pace-theme-default.css. CI fails if they don't match.
  • Version 1.3.0.

Behavior change: data-pace-options on any element other than a <script> is now ignored. To set options elsewhere, use window.paceOptions before pace.js loads.

How to verify

  • npm ci && npm test passes.
  • The new tests fail on 1.2.4: git checkout master -- pace.js pace.min.js && npx playwright test tests/security.spec.mjs (then git checkout HEAD -- pace.js pace.min.js).
  • npm run build leaves no changes.
  • npm pack --dry-run lists pace-js-1.3.0.tgz with 172 files, the same files as 1.2.4.

pace read inline options from the first element with a data-pace-options
attribute anywhere on the page. On pages that render user-supplied HTML
before pace runs, that let page content set pace's options: a __proto__
key (also nested) polluted Object.prototype, and className was inserted
into the bar's HTML without escaping.

- Inline options are read only from a <script> element.
- Option merging skips __proto__, constructor and prototype keys.
- The bar is built with DOM methods instead of an HTML string, which also
  lets pace run on pages that enforce Trusted Types.

Advisory: GHSA-5fmc-v4p3-pqpg
Add a "style" field pointing to pace-theme-default.css. jsDelivr reads
this field to find a package's CSS file, which it currently has to guess:
https://github.com/jsdelivr/jsdelivr#configuring-a-default-file-in-packagejson
The build now copies the version from package.json into the header of
pace.js and pace-theme-default.css before minifying them, so the version
is edited only in package.json:

    npm version <version> --no-git-tag-version && npm run build

The generated-files check in CI fails if a header doesn't match.
@CodeByZach CodeByZach self-assigned this Nov 2, 2026
@CodeByZach
CodeByZach merged commit 057cc7b into master Nov 2, 2026
2 checks passed
@CodeByZach
CodeByZach deleted the release-1.3.0 branch November 2, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant