[ruby-core:127486] [Ruby Bug#22550] 'script_safe' regression
Issue #22550 has been reported by altruby (Alt Ruby). ---------------------------------------- Bug #22550: 'script_safe' regression https://bugs.ruby-lang.org/issues/22550 * Author: altruby (Alt Ruby) * Status: Open * ruby -v: ruby 4.1.0dev (2026-11-14T01:18:36Z master e9e0c4f24d) +PRISM [x86_64-freebsd16.0] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- Hi I am working on something that recently cloned ruby/ruby into a FreeBSD jail and then agents built ruby and ran some experiments. One of those experiments found a regression in the 'json' library where "script_safe" would fail to sanitize certain inputs. This commit only exists on HEAD (since yesterday) and it has not been released. I just thought it might be useful to know. Thanks. Proof. Introduced by commit 9009e03929. ```ruby require "json" puts JSON.generate("</script>", script_safe: true) # escaped puts JSON.generate("</SCRIPT>", script_safe: true) # NOT escaped ``` -- https://bugs.ruby-lang.org/
Issue #22550 has been updated by altruby (Alt Ruby). Looks fixed as of https://github.com/ruby/ruby/commit/e96e01349128777374639c48c6251dbc76d28462. Feel free to close. ---------------------------------------- Bug #22550: 'script_safe' regression https://bugs.ruby-lang.org/issues/22550#change-119957 * Author: altruby (Alt Ruby) * Status: Open * ruby -v: ruby 4.1.0dev (2026-11-14T01:18:36Z master e9e0c4f24d) +PRISM [x86_64-freebsd16.0] * Backport: 3.3: UNKNOWN, 3.4: UNKNOWN, 4.0: UNKNOWN ---------------------------------------- Hi I am working on something that recently cloned ruby/ruby into a FreeBSD jail and then agents built ruby and ran some experiments. One of those experiments found a regression in the 'json' library where "script_safe" would fail to sanitize certain inputs. This commit only exists on HEAD (since yesterday) and it has not been released. I just thought it might be useful to know. Thanks. Proof. Introduced by commit 9009e03929. ```ruby require "json" puts JSON.generate("</script>", script_safe: true) # escaped puts JSON.generate("</SCRIPT>", script_safe: true) # NOT escaped ``` -- https://bugs.ruby-lang.org/
participants (1)
-
altruby (Alt Ruby)