Improper Handling of Exceptional Conditions Affecting comrak package, versions <0.17.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.46% (77th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUST-COMRAK-5291799
  • published29 Mar 2023
  • disclosed28 Mar 2023
  • creditUnknown

Introduced: 28 Mar 2023

CVE-2023-28631  (opens in a new tab)
CWE-755  (opens in a new tab)

How to fix?

Upgrade comrak to version 0.17.0 or higher.

Overview

Affected versions of this package are vulnerable to Improper Handling of Exceptional Conditions when AST can be constructed manually by a program instead of parsing a Markdown document with parse_document. This AST can then be converted to HTML via html::format_document_with_plugins. However, the HTML formatting code assumes that the AST is well-formed. For example, many AST notes contain [u8] fields which the formatting code assumes is valid UTF-8 data.

Workaround

  • Validate UTF-8 correctness of all data when assigning to &[u8] and Vec<u8> fields in the AST.

CVSS Scores

version 3.1