HIGH 7.5

CVE-2026-38976: NULL Pointer Dereference in mrubyc op_super()

mrubyc versions up to 3.4.1 contain a critical flaw in how they handle the `super` keyword when used at the top level of code. Normally, `super` calls the parent class's implementation of a method, but when invoked outside a proper method context, the application fails to validate this precondition. This causes the program to attempt to access memory that hasn't been initialized, resulting in a crash. An attacker with network access can trigger this crash remotely without needing credentials or user interaction, making the system unavailable.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-476
Affected products
0 configuration(s)
Published / Modified
2026-07-06 / 2026-07-07

NVD description (verbatim)

mrubyc through 3.4.1 was found to contain a NULL pointer dereference in src/vm.c in op_super() / OP_SUPER due to a missing runtime guard for top-level super.

4 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from a missing runtime guard in the `op_super()` function within src/vm.c. When the mrubyc virtual machine encounters a OP_SUPER opcode, it does not verify that execution is occurring within a valid method context before dereferencing the super object pointer. If `super` is invoked at the top level—outside any method definition—the pointer remains NULL, and the subsequent dereference triggers a NULL pointer exception. This violates the CWE-476 classification for improper null pointer handling. The flaw is present in all versions through 3.4.1.

Business impact

Applications built with mrubyc 3.4.1 or earlier become vulnerable to denial of service attacks. An attacker can craft malicious input or bytecode that invokes top-level `super`, crashing the mrubyc runtime and halting application functionality. For embedded systems, IoT devices, or server applications relying on mrubyc for scripting or computation, this translates to unexpected downtime and potential cascading failures in dependent services. The impact is localized to availability; data confidentiality and integrity are not compromised.

Affected systems

mrubyc versions through 3.4.1 are affected. mrubyc is a lightweight Ruby interpreter designed for embedded and resource-constrained environments. Any application, firmware, or device that embeds mrubyc as a runtime engine is at risk if it processes untrusted Ruby code or bytecode. This includes IoT platforms, embedded scripting engines, and edge computing deployments that rely on mrubyc for dynamic code execution.

Exploitability

Exploitation is straightforward and requires no authentication, user interaction, or special privileges. An attacker with network connectivity to an application running vulnerable mrubyc can trigger the crash by submitting code or data that causes the interpreter to execute `super` outside a method definition. The low attack complexity means exploitation does not require deep system knowledge or specialized tools—basic fuzzing or code injection techniques may suffice. The CVSS 3.1 score of 7.5 (HIGH) reflects network accessibility, lack of privilege barriers, and guaranteed availability impact.

Remediation

Upgrade mrubyc to a patched version that includes a runtime guard ensuring `super` is only executed within a valid method context. Contact the mrubyc project maintainers or check the official repository for patch releases addressing this NULL pointer dereference. Until patching is possible, implement input validation and code review processes to prevent untrusted Ruby code from reaching the mrubyc interpreter.

Patch guidance

Verify the latest mrubyc release from the official project repository for a version post-3.4.1 that includes the fix for CVE-2026-38976. Apply patches systematically to all embedded or deployed instances. Test patched versions in a staging environment to ensure compatibility with existing Ruby code before production rollout. Document the patch version applied for audit and compliance records.

Detection guidance

Monitor mrubyc-based applications for unexpected crashes or service interruptions, particularly if they process Ruby code from external sources. Enable verbose logging at the mrubyc runtime level to capture stack traces indicating NULL pointer dereferences in op_super(). Network-based detection is limited; focus detection efforts on application behavior anomalies such as repeated process termination or restart loops. If feasible, implement static analysis on Ruby code before execution to identify suspicious or malformed super invocations.

Why prioritize this

This vulnerability warrants rapid remediation due to its HIGH severity, network-exploitable nature, and direct impact on service availability. Organizations running mrubyc in production should prioritize patching within days rather than weeks. The low attack complexity and absence of exploitation barriers elevate urgency, especially for customer-facing or critical infrastructure applications.

Risk score, explained

The CVSS 3.1 score of 7.5 (HIGH) reflects: network accessibility (AV:N), no special attack prerequisites beyond sending crafted input (AC:L), no privilege or user interaction required (PR:N, UI:N), isolated availability impact (S:U, A:H), and no compromise of confidentiality or integrity (C:N, I:N). This positioning as HIGH—rather than CRITICAL—acknowledges that the impact is confined to denial of service; no data breach or system compromise occurs.

Frequently asked questions

Does this vulnerability allow remote code execution or data theft?

No. The vulnerability causes only a denial of service through application crash. It does not permit code execution, privilege escalation, or unauthorized data access. Confidentiality and integrity are unaffected; only availability is compromised.

How can I identify if my application uses mrubyc?

Check your application's dependencies, build logs, and documentation. mrubyc is typically embedded in projects that require a lightweight Ruby runtime. Review your source code for references to mrubyc headers (e.g., mrubyc.h) or initialization calls. Consult vendor or framework documentation if you are unsure.

What if we cannot immediately patch mrubyc?

Implement strict input validation and code review to prevent untrusted Ruby code from executing. Restrict access to mrubyc-based services to trusted networks if operationally feasible. Plan a phased patching schedule and test the patch in a non-production environment first. Monitor for exploit attempts via application logs and unusual crash patterns.

Will patching mrubyc break my existing Ruby code?

The fix is a runtime safety guard, not a semantic language change. Well-formed Ruby code that does not misuse `super` will work identically after patching. Malformed code that accidentally invokes `super` at the top level will fail during execution, but such code should not exist in production anyway. Test in staging to confirm compatibility.

This analysis is provided for informational purposes and is based on publicly available vulnerability data. No guarantee is made regarding the completeness, accuracy, or applicability of this information to any specific environment. Organizations should verify patch availability and applicability against official vendor advisories before implementation. Consult with your security team and conduct testing in non-production environments before deploying patches. This document does not constitute legal, compliance, or professional security advice. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).