CVE-2026-67986

amazing_print: amazing_print: Arbitrary code execution via Ruby code injection in AwesomeMethodArray#grep

Published Aug 13, 2026 CVSS 3.1 · 8.4 High EPSS < 1% KEV · Not listed
Description
amazing-print/amazing_print at commit dc890dfafdf07088ea901df53c19c2710e5c5234 contains a Ruby code injection condition in AwesomeMethodArray#grep. A specially named method containing Ruby interpolation syntax can be interpolated into a dynamically constructed eval string when grep is called with a block, resulting in Ruby code execution in the host process. Exploitation requires an application path that allows an attacker to influence dynamic method names.

Analysis

AI-generated

Technical impact

The vulnerability exists in the awesome method array helper of a Ruby printing library. A specially named method that contains Ruby interpolation syntax can be resolved into an interpolated string when the grep method is called with a block. The resulting string is then evaluated with eval, allowing any Ruby code contained in the method name to be executed in the host process. This is a classic code injection flaw where an attacker can run arbitrary code if they can control the method name. The impact is local code execution in the context of the application using the library, potentially leading to full system compromise if the host process runs with privileged rights.

Affected Systems

The affected product is the Ruby gem amazing-print, version at commit dc890dfafdf07088ea901df53c19c2710e5c5234. No other vendors or product versions are listed in the advisory, so only this specific gem is known to be vulnerable.

Risk and Exploitability

A CVSS score of 8.4 indicates high severity, and EPSS is not available; the vulnerability is not listed in CISA’s KEV catalog. The attack vector requires an attacker to be able to influence the name of a method that the application will dynamically refer to; this may be possible in applications that allow user‑supplied or configuration‑driven method names. Because the flaw relies on a dynamic eval, exploitation is only feasible when the attacker can provide a method name that includes interpolated Ruby code. The lack of publicly available metrics suggests that the overall risk is uncertain, but the potential for arbitrary code execution in a process that may have elevated privileges is high once the conditions are met.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to a later version of the amazing-print gem where the eval condition has been removed or guarded against interpolation
  • If an upgrade is not possible, patch the library by removing the dynamic eval statement in AwesomeMethodArray#grep or adding validation to reject interpolated method names
  • Audit all application code that passes user‑controlled strings to AwesomeMethodArray#grep and enforce strong input validation or replace usage with safer alternatives

Generated by OpenCVE AI on August 13, 2026 at 18:16 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Title Arbitrary Ruby Code Execution via Dynamic eval in amazing_print's AwesomeMethodArray#grep amazing_print: amazing_print: Arbitrary code execution via Ruby code injection in AwesomeMethodArray#grep
References
Metrics threat_severity

None

threat_severity

Important

Type Values Removed Values Added
Title Arbitrary Ruby Code Execution via Dynamic eval in amazing_print's AwesomeMethodArray#grep
Type Values Removed Values Added
Weaknesses CWE-94
Metrics cvssV3_1

{'score': 8.4, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description amazing-print/amazing_print at commit dc890dfafdf07088ea901df53c19c2710e5c5234 contains a Ruby code injection condition in AwesomeMethodArray#grep. A specially named method containing Ruby interpolation syntax can be interpolated into a dynamically constructed eval string when grep is called with a block, resulting in Ruby code execution in the host process. Exploitation requires an application path that allows an attacker to influence dynamic method names.
References

Subscriptions

No data.

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
Aug 13, 2026, 3:48 PM
Reserved
Jul 30, 2026, 12:00 AM
Status
Deferred
Published
Aug 13, 2026, 2:17 PM
Modified
Sep 8, 2026, 7:42 PM
Severity
Important
Public date
Aug 13, 2026, 12:00 AM