Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: bump version to 1.0.1 for release
Adds the [1.0.1] CHANGELOG section with both link definitions, and bumps
pyproject.toml, src/stickler/__init__.py and uv.lock together.
  • Loading branch information
digalaviz committed Oct 26, 2026
commit 09b6afefce3367e852d9e946461936d11eaa537f
60 changes: 59 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,63 @@ Each release links to full notes on the

## [Unreleased]

## [1.0.1] - 2026-10-26

### Security

- **A document value can no longer run as script in the HTML report.** With

@vawsgit vawsgit Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Blocker. A third-party PDF can still run script in a 1.0.1 report, so this headline does not hold for every document input.

The report loads pdf.js 3.11.174 from cdnjs (html_reporter.py:244 and :247), and loadPDF calls pdfjsLib.getDocument(url) with default options (interactive/main.js:538). That version is affected by CVE-2024-4367 (GHSA-wgrm-67xf-hhpq). With the default isEvalSupported: true, a crafted font in a PDF runs JavaScript in the page's origin. Every release from 0.1.3 through this branch loads the same pdf.js version with the same call.

Reproduced at this PR's head (09b6afe): generate_report(..., document_files={"invoice-001": "<crafted>.pdf"}, individual_results_jsonl_path=...) with the default ReportConfig.

  • Opening the report runs nothing.
  • Selecting invoice-001 in the Report View dropdown makes updateDocumentFiles choose the PDF renderer from the file extension (main.js:401), and the payload runs in headless Chrome.
  • The PDF fetch has to succeed. It does when the report is served over HTTP(S), which I modelled with --allow-file-access-from-files. Opened from file:// in Chrome with default settings, the fetch fails with MissingPDFException, so neither the viewer nor the payload runs.
  • Serving over HTTP is the documented way to view PDFs: src/stickler/reporting/html/README.md:123-138 tells users to run python -m http.server 8080 (line 130), because "PDF features work only when served via HTTP" (line 138).

Lines 40-44 give "do not open a report built from untrusted document data" as a precaution for users who cannot upgrade. That reads as: the precaution is unnecessary on 1.0.1. For PDFs it is still necessary.

Change requested, one of:

  1. In interactive/main.js:538, call pdfjsLib.getDocument({ url, isEvalSupported: false }). With only that change, the same PDF still renders ("Page 1 of 1") and the payload does not run. The complete fix is pdf.js 4.2.67 or later, vendored or pinned with an integrity= hash.
  2. Or leave the code and narrow this entry, the advice at lines 40-44, and the GHSA text: state that PDFs passed in document_files are not covered, and add "do not pass untrusted PDFs in document_files" to the advice.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The line is applied verbatim: pdfjsLib.getDocument({ url, isEvalSupported: false }), inside
const loadPDF = (url, canvasId, loadingId, errorId), so the property shorthand resolves as you
wrote it.

The finding, the reproduction and the headless-Chrome measurement are yours.

Verification boundary. What was measured here is that the option reaches the generated page, and
that reverting the call to getDocument(url) turns exactly one test red. The browser-level result —
that the same PDF renders while the payload does not run — is yours; it was not reproduced here,
because this side has no browser harness. If you want that half re-confirmed against the branch
rather than against your original run, it needs your setup.

Residual: this release applies the upstream-documented option-level mitigation only. It does not
upgrade the pdf.js dependency, and dependency loading and pinning are unchanged. Both are tracked
for the next release and are out of scope for this patch.

One narrowing worth having in the text: main.js is embedded only when individual results are
loaded, so this route required both document_files and individual_results_jsonl_path. Not
passing the JSONL path therefore closed this route and the <script> blob route together. Easiest
way to see it: generate a report with document_files and no JSONL path, and look for
getDocument in the output. That narrowing is in the changelog on this branch, in the
"Affected versions" paragraph.

Advisory: the severity and vector are being settled on the advisory draft rather than here,
including how to characterise the dependency route this release mitigates but does not upgrade. No
action is needed on this comment.

Request: confirm the line was applied as you measured it.

`individual_results_jsonl_path`, the report embeds each document's values as
JSON inside a `<script>` block, and `json.dumps` left `<` as is. A browser
ends the block at the first `</script`, so a ground-truth or predicted value
carrying `</script><script>...</script>` ran as its own script when the
report was opened. Values are model output or third-party documents, so this
needed no access to stickler or the host. A JSON Schema property name reached
the same block through the field thresholds. `<`, `>` and `&` are now written
as `\uXXXX`, which the page's JavaScript reads as the same characters;
U+2028 and U+2029 were already escaped by `json.dumps` and stay covered
defensively
([#431](https://github.com/awslabs/stickler/issues/431))

- **A field name can no longer inject markup into the report.** The field
performance table wrote each name into the page as raw HTML while the chart
beside it escaped the same name, so a name containing `<`, `>` or `&` was
read by the browser as markup. Field names come from a JSON Schema or a
Stickler config, so they are arbitrary strings. This section renders whether
or not `individual_results_jsonl_path` is passed. The table's confusion
counts and the confusion-matrix cell are escaped alongside it; those are
library-computed integers on the `ProcessEvaluation` path and were reachable
only by passing `generate_report()` a hand-assembled metrics dict
([#422](https://github.com/awslabs/stickler/issues/422))

- **Affected versions.** Every release from 0.1.3 to 1.0.0 carries the
`<script>` breakout, and there is no patch for the 0.x line. If you cannot
upgrade: do not pass `individual_results_jsonl_path`, do not open a report
built from untrusted document data, and do not build a report from a schema
or Stickler config whose field names you do not control.

### Fixed

- **A truncated non-match value no longer ends in half an entity.** The
non-matches table escaped a value and then cut it to 100 characters, so the
cut could land inside an entity and leave `&am`. It truncates first and
escapes after, which also means the cell now keeps 100 raw characters rather
than 100 escaped ones
([#431](https://github.com/awslabs/stickler/issues/431))

- **A field name that is not a string no longer raises** in the field
performance chart
([#422](https://github.com/awslabs/stickler/issues/422))

- **A non-string document identifier no longer takes the whole report down in the non-matches
table.**
The non-matches table escaped `doc_id` and `field_path` without converting
them first, while the three columns beside them converted.
`evaluate_dataframe` reads `doc_id` straight off a DataFrame column, so an
integer id — ordinary for one read from CSV, parquet or a database — raised
and `generate_report()` returned `success=False` having written no page at
all. The document gallery, reached through the `document_files` argument, is
unchanged and still requires `str` keys and paths

## [1.0.0] - 2026-09-11

### Added
Expand Down Expand Up @@ -2331,7 +2388,8 @@ Initial public release: structured JSON comparison with configurable
comparators, Hungarian-algorithm list matching, confusion-matrix metrics, and
HTML reporting.

[Unreleased]: https://github.com/awslabs/stickler/compare/v1.0.0...dev
[Unreleased]: https://github.com/awslabs/stickler/compare/v1.0.1...dev
[1.0.1]: https://github.com/awslabs/stickler/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/awslabs/stickler/compare/v0.7.0...v1.0.0
[0.7.0]: https://github.com/awslabs/stickler/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/awslabs/stickler/compare/v0.5.0...v0.6.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "stickler-eval"
version = "1.0.0"
version = "1.0.1"
description = "Structured object comparison and evaluation library"
authors = [
{name = "Spencer Romo", email = "sromo@amazon.com"},
Expand Down
2 changes: 1 addition & 1 deletion src/stickler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def __dir__() -> list:
"""Include lazily-available comparators in `dir(stickler)`."""
return sorted(set(globals()) | set(__all__))

__version__ = "1.0.0"
__version__ = "1.0.1"
__all__ = [
# Models and evaluation
"StructuredModel",
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading