Repository navigation
fix(#338): upgrade bundled underscore to 1.13.8 - #339
Merged
Merged
Conversation
Fixes CVE-2026-27601 (unbounded recursion in _.flatten / _.isEqual). 1.13's UMD header registers a named AMD module and skips the global when define.amd is present. The bundled builds now wrap underscore in (function (define) {...})() so it always sets window._ like 1.1.7 did. lib/underscore-min.js is built by smoosh rather than taken from upstream, whose min file uses an unquoted `default:` key (IE8 syntax error). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
cesutherland
force-pushed
the
cesutherland/338-fix-underscore-vuln
branch
from
October 12, 2026 14:59
01a21ac to
ac94f8e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #338.
Upgrades the bundled Underscore from 1.1.7 to 1.13.8, which fixes CVE-2026-27601 (stack overflow from unbounded recursion in
_.flatten/_.isEqual).Risk to Flotr2 itself: Flotr2 never calls
flattenorisEqual. The exposure is to host pages that use the global_the full build sets. Every Underscore function Flotr2 uses (22 of them, including theinclude/anyaliases) still exists in 1.13.8.Changes
lib/underscore.js: the 1.13.8 UMD build (danglingsourceMappingURLremoved).lib/underscore-min.js: generated by our smoosh build, not taken from upstream. Upstream's min file has an unquoteddefault:key, which is a syntax error in IE8. Smoosh keeps it quoted.Makefile: wraps the bundled Underscore in(function (define) {…})();. The 1.13 UMD header callsdefine('underscore', …)and skips the global whendefine.amdexists. 1.1.7 ignored AMD and always setwindow._, so without the wrapper this would change behaviour and add a named module that could collide with the host's ownunderscore.Not included
flotr2.js,flotr2.min.js, …) aren't rebuilt here. They get regenerated in the release commit, as usual, so the fix reaches users with the next release.Testing
make test: 52/52 Playwright tests pass, no snapshot diffs.define.amdstubbed, the builtflotr2.jsandflotr2.min.jssetwindow._.VERSION === '1.13.8'and don't register anunderscoremodule.🤖 Generated with Claude Code