Vulnerabilities in pkg:gem/redcarpet

PACKAGE
Advisory Identifier: GHSA-7322-9mx6-5j2m
Advisory Summary

CVE-2015-5147 is a HIGH redcarpet buffer overflow vulnerability vulnerability (CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer) affecting Redcarpet libraries in the RubyGems ecosystem. The issue involves redcarpet buffer overflow vulnerability. Remediation is available by upgrading affected packages to version 3.3.2.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:gem/redcarpet

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:gem/redcarpet. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7322-9mx6-5j2m CVE-2015-5147 HIGH redcarpet Buffer Overflow vulnerability
GHSA-q3wr-qw3g-3p4h CVE-2020-26298 MODERATE Injection/XSS in Redcarpet

CVE-2015-5147 at a Glance

CVE Identifier CVE-2015-5147
GHSA Identifier GHSA-7322-9mx6-5j2m
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
Affected Product Redcarpet
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2015-5147

To remediate this vulnerability, upgrade all affected Redcarpet dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

redcarpet fixed: 3.3.2
Upgrade redcarpet to 3.3.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for redcarpet

How to Check if You Are Affected

To determine whether your application is affected by CVE-2015-5147, inspect your project dependencies for Redcarpet:

inspect dependencies for redcarpet

Analyze the terminal output to locate any version of Redcarpet in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer, where the product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. this may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data. In Redcarpet, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Stack-based buffer overflow in the `header_anchor` function in the HTML renderer in Redcarpet before 3.3.2 allows attackers to cause a denial of service (crash) and possibly execute arbitrary code via unspecified vectors.

CVE-2015-5147 Affected Redcarpet Versions

1 component(s)
Fixed Versions:
3.3.2
Product / Package Ecosystem Affected Versions Fixed Version
redcarpet
RubyGems
≥ 3.3.0
< 3.3.2
3.3.2

References

Frequently Asked Questions

What is CVE-2015-5147?
CVE-2015-5147 is a security vulnerability in Redcarpet involving redcarpet Buffer Overflow vulnerability under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer.
Which Redcarpet versions are affected?
Affected versions include releases prior to 3.3.2 across affected packages: redcarpet.
What version fixes CVE-2015-5147?
Upgrading to 3.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is redcarpet affected?
Yes, redcarpet is affected in releases prior to 3.3.2. Upgrade your dependency to 3.3.2 or later.
What CWE is associated with CVE-2015-5147?
CVE-2015-5147 is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer (The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.).
How can I check RubyGems dependencies for CVE-2015-5147?
Run the dependency tree command: 'inspect dependencies for redcarpet'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7322-9mx6-5j2m",
  "modified" : "2023-01-23T20:45:35Z",
  "published" : "2018-08-15T20:04:30Z",
  "aliases" : [ "CVE-2015-5147" ],
  "summary" : "redcarpet Buffer Overflow vulnerability",
  "details" : "Stack-based buffer overflow in the `header_anchor` function in the HTML renderer in Redcarpet before 3.3.2 allows attackers to cause a denial of service (crash) and possibly execute arbitrary code via unspecified vectors.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "redcarpet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.3.0"
      }, {
        "fixed" : "3.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2015-5147"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vmg/redcarpet/commit/2cee777c1e5babe8a1e2683d31ea75cc4afe55fb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vmg/redcarpet"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vmg/redcarpet/blob/master/CHANGELOG.md"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20150711061256/http://www.securityfocus.com/bid/75508"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2015/06/29/3"
  }, {
    "type" : "WEB",
    "url" : "http://www.openwall.com/lists/oss-security/2015/06/30/10"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-119" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:21:00Z",
    "nvd_published_at" : null
  }
}