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 9.18.5 to 10.7.1 #257

Closed

Conversation

dependabot-preview[bot]
Copy link

Bumps highlight.js from 9.18.5 to 10.7.1. This update includes a security fix.

Vulnerabilities fixed

Sourced from The GitHub Security Advisory Database.

ReDOS vulnerabities: multiple grammars

Impact: Potential ReDOS vulnerabilities (exponential and polynomial RegEx backtracking)

oswasp:

> The Regular expression Denial of Service (ReDoS) is a Denial of Service attack, that exploits the fact that most Regular Expression implementations may reach extreme situations that cause them to work very slowly (exponentially related to input size). An attacker can then cause a program using a Regular Expression to enter these extreme situations and then hang for a very long time.

If are you are using Highlight.js to highlight user-provided data you are possibly vulnerable. On the client-side (in a browser or Electron environment) risks could include lengthy freezes or crashes... On the server-side infinite freezes could occur... effectively preventing users from accessing your app or service (ie, Denial of Service).

This is an issue with grammars shipped with the parser (and potentially 3rd party grammars also), not the parser itself. If you are using Highlight.js with any of the following grammars you are vulnerable. If you are using highlightAuto to detect the language (and have any of these grammars registered) you are vulnerable.

All versions prior to 10.4.1 are vulnerable, including version 9.18.5.

Grammars with exponential backtracking issues:

  • c-like (c, cpp, arduino)
  • handlebars (htmlbars)
  • gams
  • perl
  • jboss-cli
  • r

... (truncated)

Affected versions: >= 9.0.0 < 10.4.1

Release notes

Sourced from highlight.js's releases.

10.7.1 - Spring Edition

This .1 patch release fixes an issue with the TypeScript typing info in 10.7.0.

Release notes from 10.7.0

Parser:

  • enh(api) add unregisterLanguage method (#3009) [Antoine du Hamel][]
  • enh: Make alias registration case insensitive (#3026) [David Ostrovsky][]
  • fix(parser) highlightAll() now works if the library is lazy loaded [Josh Goebel][]

New Languages:

  • Added 3rd party RiScript grammar to SUPPORTED_LANGUAGES (#2988) [John C][]
  • Added 3rd party HLSL grammar to SUPPORTED_LANGUAGES (#3002) [Stef Levesque][]
  • Added 3rd party Q# grammar to SUPPORTED_LANGUAGES(#3006) [Vyron Vasileiadis][]

Language grammar improvements:

  • fix(python) allow keywords immediately following numbers (#2985) [Josh Goebel][]
  • fix(xml) char immediately following tag close mis-highlighted (#3044) [Josh Goebel][]
  • fix(ruby) fix defined?() mis-highlighted as def (#3025) [Josh Goebel][]
  • fix(c) comments after #include <str> blocks (#3041) [Josh Goebel][]
  • fix(cpp) comments after #include <str> blocks (#3041) [Josh Goebel][]
  • enh(cpp) Highlight all function dispatches (#3005) [Josh Goebel][]
  • enh(python) support type hints and better type support (#2972) [Josh Goebel][]
  • enh(gml) Add additional GML 2.3 keywords (#2984) [xDGameStudios][]
  • fix(cpp) constructor support for initializers (#3001) [Josh Goebel][]
  • enh(php) Add trait to class-like naming patterns (#2997) [Ayesh][]
  • enh(php) Add Stringable, UnhandledMatchError, and WeakMap classes/interfaces (#2997) [Ayesh][]
  • enh(php) Add mixed to list of keywords (#2997) [Ayesh][]
  • enh(php) Add support binary, octal, hex and scientific numerals with underscore separator support (#2997) [Ayesh][]
  • enh(php) Add support for Enums (#3004) [Ayesh][]
  • enh(ecmascript) Add built-in types [Vaibhav Chanana][]
  • enh(kotlin) Add kts as an alias for Kotlin (#3021) [Vaibhav Chanana][]
  • enh(css) Add font-smoothing to attributes list for CSS (#3027) [AndyKIron][]
  • fix(python) Highlight print and exec as a builtin (#1468) [Samuel Colvin][]
  • fix(csharp) Fix unit being highlighted instead of uint (#3046) [Spacehamster][]
  • enh(swift) add async/await keywords (#3048) [Bradley Mackey][]

Deprecations:

  • highlight(languageName, code, ignoreIllegals, continuation) deprecated as of 10.7
    • Please use the newer API which takes code and then accepts options as an object
    • IE: highlight(code, {language, ignoreIllegals})
    • continuation is for internal use only and no longer supported
  • highlightBlock(el) deprecated as of 10.7.
    • Please use highlightElement(el) instead.
    • Plugin callbacks renamed before/after:highlightBlock => before/after:highlightElement
    • Plugin callback now takes el vs block attribute

... (truncated)

Changelog

Sourced from highlight.js's changelog.

Version 10.7.1

  • fix(parser) Resolves issues with TypeScript types [Josh Goebel][]

Version 10.7.0

Parser:

  • enh(api) add unregisterLanguage method (#3009) [Antoine du Hamel][]
  • enh: Make alias registration case insensitive (#3026) [David Ostrovsky][]
  • fix(parser) highlightAll() now works if the library is lazy loaded [Josh Goebel][]

New Languages:

  • Added 3rd party RiScript grammar to SUPPORTED_LANGUAGES (#2988) [John C][]
  • Added 3rd party HLSL grammar to SUPPORTED_LANGUAGES (#3002) [Stef Levesque][]
  • Added 3rd party Q# grammar to SUPPORTED_LANGUAGES(#3006) [Vyron Vasileiadis][]

Language grammar improvements:

  • enh(parser) smarter detection of comments (#2827) [Josh Goebel][]
  • fix(python) allow keywords immediately following numbers (#2985) [Josh Goebel][]
  • fix(xml) char immediately following tag close mis-highlighted (#3044) [Josh Goebel][]
  • fix(ruby) fix defined?() mis-highlighted as def (#3025) [Josh Goebel][]
  • fix(c) comments after #include <str> blocks (#3041) [Josh Goebel][]
  • fix(cpp) comments after #include <str> blocks (#3041) [Josh Goebel][]
  • enh(cpp) Highlight all function dispatches (#3005) [Josh Goebel][]
  • enh(python) support type hints and better type support (#2972) [Josh Goebel][]
  • enh(gml) Add additional GML 2.3 keywords (#2984) [xDGameStudios][]
  • fix(cpp) constructor support for initializers (#3001) [Josh Goebel][]
  • enh(php) Add trait to class-like naming patterns (#2997) [Ayesh][]
  • enh(php) Add Stringable, UnhandledMatchError, and WeakMap classes/interfaces (#2997) [Ayesh][]
  • enh(php) Add mixed to list of keywords (#2997) [Ayesh][]
  • enh(php) Add support binary, octal, hex and scientific numerals with underscore separator support (#2997) [Ayesh][]
  • enh(php) Add support for Enums (#3004) [Ayesh][]
  • enh(ecmascript) Add built-in types [Vaibhav Chanana][]
  • enh(kotlin) Add kts as an alias for Kotlin (#3021) [Vaibhav Chanana][]
  • enh(css) Add font-smoothing to attributes list for CSS (#3027) [AndyKIron][]
  • fix(python) Highlight print and exec as a builtin (#1468) [Samuel Colvin][]
  • fix(csharp) Fix unit being highlighted instead of uint (#3046) [Spacehamster][]
  • enh(swift) add async/await keywords (#3048) [Bradley Mackey][]

Deprecations:

  • highlight(languageName, code, ignoreIllegals, continuation) deprecated as of 10.7
    • Please use the newer API which takes code and then accepts options as an object
    • IE: highlight(code, {language, ignoreIllegals})
    • continuation is for internal use only and no longer supported
  • highlightBlock(el) deprecated as of 10.7.
    • Please use highlightElement(el) instead.

... (truncated)

Commits
  • 421b23b (chore) fix TS issue, bump 10.7.1
  • 7ec45af (chore) bump version to 10.7.0
  • bfb5a59 enh(parser) new highlight() API (#3053)
  • 6f24850 (cleanup) better boolean naming
  • 695ff64 (chore) add shebang for build script
  • 23ae72c (chore) rename master branch to main
  • 13adf5c (chore) update plugin API docs
  • e637c7b (chore) auto-lint csharp
  • df5bc7a enh(http) support headers without preamble (#3051)
  • 87019cb fix(python) allow keywords immediately following numbers (#3050)
  • Additional commits viewable in compare view
Maintainer changes

This version was pushed to npm by highlightjs_bot, 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.


Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking Bump now in your Dependabot dashboard.

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)

Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.18.5 to 10.7.1. **This update includes a security fix.**
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/main/CHANGES.md)
- [Commits](highlightjs/highlight.js@9.18.5...10.7.1)

Signed-off-by: dependabot-preview[bot] <[email protected]>
@dependabot-preview dependabot-preview bot added dependencies Pull requests that update a dependency file security Pull requests that address a security vulnerability labels Mar 31, 2021
@dependabot-preview
Copy link
Author

Superseded by #259.

@dependabot-preview dependabot-preview bot deleted the dependabot/npm_and_yarn/highlight.js-10.7.1 branch April 6, 2021 21:34
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