RubySec

Providing security resources for the Ruby community

CVE-2026-54901 (oj): Oj- Use-After-Free in 'Oj::Parser' array_class/hash_class GC Marking

Oj- Use-After-Free in 'Oj::Parser' array_class/hash_class GC Marking

Published: June 19, 2026

SECURITY IDENTIFIERS

GEM

oj

PATCHED VERSIONS

>= 3.17.3

DESCRIPTION

Summary

Oj::Parser in usual mode does not mark array_class and hash_class references during garbage collection. If GC runs after the class is assigned but before a parse, the class object is reclaimed, leaving the parser holding a dangling VALUE. The subsequent parse call dereferences the freed object, producing a segfault.

RELATED