Lucene search

K
rubygemsRubySecRUBY:COMMONMARKER-2024-22051
HistoryMar 02, 2022 - 9:00 p.m.

Integer overflow in cmark-gfm table parsing extension leads to heap memory corruption

2022-03-0221:00:00
RubySec
github.com
12
commonmarker
cmark-gfm
integer overflow
heap memory corruption
table parsing
github flavored markdown
vulnerability
remote code execution
patch

CVSS3

9.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

AI Score

8

Confidence

High

Impact

CommonMarker uses cmark-gfm for rendering
Github Flavored Markdown.
An integer overflow in cmark-gfm’s table row parsing
may lead to heap memory corruption when parsing tables who’s marker
rows contain more than UINT16_MAX columns. The impact of this heap
corruption ranges from Information Leak to Arbitrary Code Execution.

If affected versions of CommonMarker are used for rendering remote
user controlled markdown, this vulnerability may lead to
Remote Code Execution (RCE).

Patches

This vulnerability has been patched in the following CommonMarker release:

  • v0.23.4

Workarounds

The vulnerability exists in the table markdown extensions of
cmark-gfm. Disabling any use of the table extension will prevent
this vulnerability from being triggered.

References

Acknowledgements

We would like to thank Felix Wilhelm of Google’s Project Zero
for reporting this vulnerability

For more information

If you have any questions or comments about this advisory:

Affected configurations

Vulners
Node
rubycommonmarkerRange0.23.4
VendorProductVersionCPE
rubycommonmarker*cpe:2.3:a:ruby:commonmarker:*:*:*:*:*:*:*:*

CVSS3

9.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

AI Score

8

Confidence

High