Project

General

Profile

Actions

Bug #22550

closed

'script_safe' regression

Bug #22550: 'script_safe' regression

Added by altruby (Alt Ruby) 3 days ago. Updated 2 days ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 4.1.0dev (2026-11-14T01:18:36Z master e9e0c4f24d) +PRISM [x86_64-freebsd16.0]
[ruby-core:127486]

Description

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.

require "json"
puts JSON.generate("</script>", script_safe: true)   # escaped
puts JSON.generate("</SCRIPT>", script_safe: true)   # NOT escaped

Updated by Earlopain (Earlopain _) 2 days ago Actions #2

  • Status changed from Open to Closed
Actions

Also available in: PDF Atom