Fedora Account System
Red Hat Associate
Red Hat Customer
A flaw was found in rubygem-safemode. The parser allows op-assign AST nodes (op_asgn2, op_asgn_or, op_asgn_and, safe_op_asgn2, op_asgn1) without inserting .to_jail on the receiver, so compound assignment expressions such as x.foo ||= v, x.foo &&= v, x.foo += v, and x[k] += v execute getters, setters, and index operators directly on the real object. This completely bypasses the Jail method allow-list that is intended to mediate all method calls in sandboxed template code. An authenticated user who can influence Foreman/Satellite template content can invoke arbitrary no-argument methods on unjailed render-scope objects — including Host#destroy, which Host::Jail deliberately excludes — as well as disclose Jail-excluded getters and write through setters. Because the receiver is not jailed, other zero-argument ActiveRecord methods (for example attributes) are expected to be similarly reachable. Reported via foreman-security / PSIRTSUPT-25192 (coordination) and PSIRTSUPT-25106 (initial forward). Credit: Kaya Emre Arikan (GitHub @kemrec). Confirmed by Foreman Security (Lukas Zapletal): a template-only user can call @host.destroy and delete the host record.