Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security] Bump highlight.js from 10.0.3 to 10.4.0 #174

Conversation

dependabot-preview[bot]
Copy link
Contributor

Bumps highlight.js from 10.0.3 to 10.4.0. This update includes a security fix.

Vulnerabilities fixed

Sourced from The GitHub Security Advisory Database.

Prototype Pollution in highlight.js

Impact

Affected versions of this package are vulnerable to Prototype Pollution. A malicious HTML code block can be crafted that will result in prototype pollution of the base object's prototype during highlighting. If you allow users to insert custom HTML code blocks into your page/app via parsing Markdown code blocks (or similar) and do not filter the language names the user can provide you may be vulnerable.

The pollution should just be harmless data but this can cause problems for applications not expecting these properties to exist and can result in strange behavior or application crashes, i.e. a potential DOS vector.

If your website or application does not render user provided data it should be unaffected.

Patches

Versions 9.18.2 and 10.1.2 and newer include fixes for this vulnerability. If you are using version 7 or 8 you are encouraged to upgrade to a newer release.

Workarounds

Patch your library

Manually patch your library to create null objects for both languages and aliases:

const HLJS = function(hljs) {
</tr></table> ... (truncated)
Affected versions: >= 10.0.0 < 10.1.2

Release notes

Sourced from highlight.js's releases.

10.4.0 - November 2020

A largish release with many improvements and fixes from quite a few different contributors. Enjoy!

Deprecations:

  • (chore) requireLanguage is deprecated.
    • Prefer getLanguage (with custom error handling) or built-time dependencies.
    • See Library API for more information.

Parser:

  • enh(parser) use negative look-ahead for beginKeywords support (#2813) [Josh Goebel][]
  • enh(grammars) allow classNameAliases for more complex grammars [Josh Goebel][]
  • fix(vue): Language name now appears in CSS class (#2807) [Michael Rush][]
  • (chore) Clean up all regexs to be UTF-8 compliant/ready (#2759) [Josh Goebel][]

New Languages:

  • Added 3rd party Chapel grammar to SUPPORTED_LANGUAGES (#2806) [Brad Chamberlain][]
  • Added BBCode grammar to SUPPORTED_LANGUAGES (#2867) [Paul Reid][]
  • enh(javascript) Added node-repl for Node.js REPL sessions (#2792) [Marat Nagayev][]

Language Improvements:

  • enh(shell) Recognize prompts which contain tilde ~ (#2859) [Guillaume Grossetie][]
  • enh(shell) Add support for multiline commands with line continuation \ (#2861) [Guillaume Grossetie][]
  • enh(autodetect) Over 30+ improvements to auto-detect (#2745) [Josh Goebel][]
    • 4-5% improvement in auto-detect against large sample set
    • properties, angelscript, lsl, javascript, n1ql, ocaml, ruby
    • protobuf, hy, scheme, crystal, yaml, r, vbscript, groovy
    • python, java, php, lisp, matlab, clojure, csharp, css
  • fix(r) fixed keywords not properly spaced (#2852) [Josh Goebel][]
  • fix(javascript) fix potential catastrophic backtracking (#2852) [Josh Goebel][]
  • fix(livescript) fix potential catastrophic backtracking (#2852) [Josh Goebel][]
  • bug(xml) XML grammar was far too imprecise/fuzzy [Josh Goebel][]
  • enh(xml) Improve precision to prevent false auto-detect positives [Josh Goebel][]
  • fix(js/ts) Prevent for/while/if/switch from falsly matching as functions (#2803) [Josh Goebel][]
  • enh(julia) Update keyword lists for Julia 1.x (#2781) [Fredrik Ekre][]
  • enh(python) Match numeric literals per the language reference [Richard Gibson][]
  • enh(ruby) Match numeric literals per language documentation [Richard Gibson][]
  • enh(javascript) Match numeric literals per ECMA-262 spec [Richard Gibson][]
  • enh(java) Match numeric literals per Java Language Specification [Richard Gibson][]
  • enh(swift) Match numeric literals per language reference [Richard Gibson][]
  • enh(php) highlight variables (#2785) [Taufik Nurrohman][]
  • fix(python) Handle comments on decorators (#2804) [Jonathan Sharpe][]
  • enh(diff) improve highlighting of diff for git patches [Florian Bezdeka][]
  • fix(llvm) lots of small improvements and fixes (#2830) [Josh Goebel][]
  • enh(mathematica) Rework entire implementation [Patrick Scheibe][]
    • Correct matching of the many variations of Mathematica's numbers
    • Matching of named-characters aka special symbols like \[Gamma]
Changelog

Sourced from highlight.js's changelog.

Version 10.4.0

A largish release with many improvements and fixes from quite a few different contributors. Enjoy!

Deprecations:

  • (chore) requireLanguage is deprecated.
    • Prefer getLanguage (with custom error handling) or built-time dependencies.
    • See Library API for more information.

Parser:

  • enh(parser) use negative look-ahead for beginKeywords support (#2813) [Josh Goebel][]
  • enh(grammars) allow classNameAliases for more complex grammars [Josh Goebel][]
  • fix(vue): Language name now appears in CSS class (#2807) [Michael Rush][]
  • (chore) Clean up all regexs to be UTF-8 compliant/ready (#2759) [Josh Goebel][]

New Languages:

  • Added 3rd party Chapel grammar to SUPPORTED_LANGUAGES (#2806) [Brad Chamberlain][]
  • Added BBCode grammar to SUPPORTED_LANGUAGES (#2867) [Paul Reid][]
  • enh(javascript) Added node-repl for Node.js REPL sessions (#2792) [Marat Nagayev][]

Language Improvements:

  • enh(shell) Recognize prompts which contain tilde ~ (#2859) [Guillaume Grossetie][]
  • enh(shell) Add support for multiline commands with line continuation \ (#2861) [Guillaume Grossetie][]
  • enh(autodetect) Over 30+ improvements to auto-detect (#2745) [Josh Goebel][]
    • 4-5% improvement in auto-detect against large sample set
    • properties, angelscript, lsl, javascript, n1ql, ocaml, ruby
    • protobuf, hy, scheme, crystal, yaml, r, vbscript, groovy
    • python, java, php, lisp, matlab, clojure, csharp, css
  • fix(r) fixed keywords not properly spaced (#2852) [Josh Goebel][]
  • fix(javascript) fix potential catastrophic backtracking (#2852) [Josh Goebel][]
  • fix(livescript) fix potential catastrophic backtracking (#2852) [Josh Goebel][]
  • bug(xml) XML grammar was far too imprecise/fuzzy [Josh Goebel][]
  • enh(xml) Improve precision to prevent false auto-detect positives [Josh Goebel][]
  • fix(js/ts) Prevent for/while/if/switch from falsly matching as functions (#2803) [Josh Goebel][]
  • enh(julia) Update keyword lists for Julia 1.x (#2781) [Fredrik Ekre][]
  • enh(python) Match numeric literals per the language reference [Richard Gibson][]
  • enh(ruby) Match numeric literals per language documentation [Richard Gibson][]
  • enh(javascript) Match numeric literals per ECMA-262 spec [Richard Gibson][]
  • enh(java) Match numeric literals per Java Language Specification [Richard Gibson][]
  • enh(swift) Match numeric literals per language reference [Richard Gibson][]
  • enh(php) highlight variables (#2785) [Taufik Nurrohman][]
  • fix(python) Handle comments on decorators (#2804) [Jonathan Sharpe][]
  • enh(diff) improve highlighting of diff for git patches [Florian Bezdeka][]
  • fix(llvm) lots of small improvements and fixes (#2830) [Josh Goebel][]
  • enh(mathematica) Rework entire implementation [Patrick Scheibe][]
    • Correct matching of the many variations of Mathematica's numbers
Commits
  • 4055826 10.4.0 release
  • ee28327 chore(docs) update maintainer guide
  • c91fadd chore(deps) bump deep-freeze to get build bug fix
  • f0c4a36 (chore) eslint --fix against most grammars (#2853)
  • b4b5bf0 chore(docs) add Slack invite link
  • 6698b8a chore(tests) auto-generated markup tests for all languages (#2862)
  • 4fed71d enh(shell) recognize prompts that contain tilde(s) (#2859)
  • c36d5ae enh(shell) Support multiline commands (#2861)
  • 3375ec6 chore(docs) add beta badge
  • 7fc446c chore(build) tighter terser opts, saves ~50 bytes gzipped
  • Additional commits viewable in compare view
Maintainer changes

This version was pushed to npm by isagalaev, a new releaser for highlight.js since your current version.


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

@dependabot-preview dependabot-preview bot added dependencies Pull requests that update a dependency file security Pull requests that address a security vulnerability labels Nov 24, 2020
@dependabot-preview
Copy link
Contributor Author

Superseded by #179.

@dependabot-preview dependabot-preview bot deleted the dependabot/npm_and_yarn/highlight.js-10.4.0 branch December 4, 2020 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file security Pull requests that address a security vulnerability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants