<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/ext/json/generator/generator.c, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Merge JSON 2.7.2 for Ruby 3.3 (#11541)</title>
<updated>2024-09-04T15:47:06+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2024-09-04T15:47:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=4eb51dfc9e67683a1a03fdf302d5ddd95cad716a'/>
<id>4eb51dfc9e67683a1a03fdf302d5ddd95cad716a</id>
<content type='text'>
Merge JSON 2.7.2</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Merge JSON 2.7.2</pre>
</div>
</content>
</entry>
<entry>
<title>Manually merged from flori/json</title>
<updated>2023-12-01T07:47:06+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2023-12-01T06:51:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=86045fca24be94db7a9cbf7a9126e43c212dcc55'/>
<id>86045fca24be94db7a9cbf7a9126e43c212dcc55</id>
<content type='text'>
  &gt; https://github.com/flori/json/pull/525
  &gt; Rename escape_slash in script_safe and also escape E+2028 and E+2029

  Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;

  &gt; https://github.com/flori/json/pull/454
  &gt; Remove unnecessary initialization of create_id in JSON.parse()

  Co-authored-by: Watson &lt;watson1978@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
  &gt; https://github.com/flori/json/pull/525
  &gt; Rename escape_slash in script_safe and also escape E+2028 and E+2029

  Co-authored-by: Jean Boussier &lt;jean.boussier@gmail.com&gt;

  &gt; https://github.com/flori/json/pull/454
  &gt; Remove unnecessary initialization of create_id in JSON.parse()

  Co-authored-by: Watson &lt;watson1978@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Rename escape_slash in script_safe and also escape E+2028 and E+2029</title>
<updated>2023-12-01T07:47:06+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2023-04-13T17:22:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0dfeb172968cdaefca2ab828c94d3e5f44d91f8f'/>
<id>0dfeb172968cdaefca2ab828c94d3e5f44d91f8f</id>
<content type='text'>
It is rather common to directly interpolate JSON string inside
&lt;script&gt; tags in HTML as to provide configuration or parameters to a
script.

However this may lead to XSS vulnerabilities, to prevent that 3
characters need to be escaped:

  - `/` (forward slash)
  - `U+2028` (LINE SEPARATOR)
  - `U+2029` (PARAGRAPH SEPARATOR)

The forward slash need to be escaped to prevent closing the script
tag early, and the other two are valid JSON but invalid Javascript
and can be used to break JS parsing.

Given that the intent of escaping forward slash is the same than escaping
U+2028 and U+2029, I chos to rename and repurpose the existing `escape_slash`
option.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is rather common to directly interpolate JSON string inside
&lt;script&gt; tags in HTML as to provide configuration or parameters to a
script.

However this may lead to XSS vulnerabilities, to prevent that 3
characters need to be escaped:

  - `/` (forward slash)
  - `U+2028` (LINE SEPARATOR)
  - `U+2029` (PARAGRAPH SEPARATOR)

The forward slash need to be escaped to prevent closing the script
tag early, and the other two are valid JSON but invalid Javascript
and can be used to break JS parsing.

Given that the intent of escaping forward slash is the same than escaping
U+2028 and U+2029, I chos to rename and repurpose the existing `escape_slash`
option.
</pre>
</div>
</content>
</entry>
<entry>
<title>[flori/json] Call `super` in `included` hook</title>
<updated>2023-05-24T00:37:30+00:00</updated>
<author>
<name>Ufuk Kayserilioglu</name>
<email>ufuk.kayserilioglu@shopify.com</email>
</author>
<published>2021-10-25T12:48:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=12dfd9d1c980d17d8a0ea10bccb9cd7eca21b568'/>
<id>12dfd9d1c980d17d8a0ea10bccb9cd7eca21b568</id>
<content type='text'>
The C extension defines an `included` hook for the
`JSON::Ext::Generator::GeneratorMethods::String` module but neglects to
call `super` in the hook. This can break the functionality of various
other code that rely on the fact that `included` on `Module` will always
be called.

https://github.com/flori/json/commit/cd8bbe56a3
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The C extension defines an `included` hook for the
`JSON::Ext::Generator::GeneratorMethods::String` module but neglects to
call `super` in the hook. This can break the functionality of various
other code that rely on the fact that `included` on `Module` will always
be called.

https://github.com/flori/json/commit/cd8bbe56a3
</pre>
</div>
</content>
</entry>
<entry>
<title>[flori/json] Stop including the parser source __LINE__ in exceptions</title>
<updated>2022-07-29T10:10:10+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2021-05-20T10:40:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=66b52f046f3e4c5d24781a142f9633e07c42d6d9'/>
<id>66b52f046f3e4c5d24781a142f9633e07c42d6d9</id>
<content type='text'>
It makes testing for JSON errors very tedious. You either have
to use a Regexp or to regularly update all your assertions
when JSON is upgraded.

https://github.com/flori/json/commit/de9eb1d28e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It makes testing for JSON errors very tedious. You either have
to use a Regexp or to regularly update all your assertions
when JSON is upgraded.

https://github.com/flori/json/commit/de9eb1d28e
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix GC compatibility: Don't stash encodings in global constants</title>
<updated>2021-02-01T20:20:34+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2021-02-01T19:10:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=8ef30bcc047341b2b7e6ec9b545dda975cdd4ab2'/>
<id>8ef30bcc047341b2b7e6ec9b545dda975cdd4ab2</id>
<content type='text'>
This value should either be pinned, or looked up when needed at runtime.
Without pinning, the GC may move the encoding object, and that could
cause a crash.

In this case it is easier to find the value at runtime, and there is no
performance penalty (as Ruby caches encoding indexes).  We can shorten
the code, be compaction friendly, and incur no performance penalty.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This value should either be pinned, or looked up when needed at runtime.
Without pinning, the GC may move the encoding object, and that could
cause a crash.

In this case it is easier to find the value at runtime, and there is no
performance penalty (as Ruby caches encoding indexes).  We can shorten
the code, be compaction friendly, and incur no performance penalty.
</pre>
</div>
</content>
</entry>
<entry>
<title>[json] Make json Ractor safe</title>
<updated>2020-12-21T13:10:43+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@mrkn.jp</email>
</author>
<published>2020-12-21T06:57:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=14d7d1df25bbefadfc385042d541b4afc31e4c1b'/>
<id>14d7d1df25bbefadfc385042d541b4afc31e4c1b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[json] Stop using prototype objects</title>
<updated>2020-12-21T13:10:33+00:00</updated>
<author>
<name>Kenta Murata</name>
<email>mrkn@mrkn.jp</email>
</author>
<published>2020-12-20T03:17:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=98cc15ed1e9193e17fad6b87cccf8f8b5ade7801'/>
<id>98cc15ed1e9193e17fad6b87cccf8f8b5ade7801</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add an option to escape forward slash character</title>
<updated>2020-09-25T08:28:42+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2020-01-30T11:48:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e1659af3724e2320e9f2f2bd7cf602686e8aa523'/>
<id>e1659af3724e2320e9f2f2bd7cf602686e8aa523</id>
<content type='text'>
Squashed commit of the following:

commit 26d181059989279a79c433cedcd893b4f52e42ee
Author: Francois Chagnon &lt;francois.chagnon@jadedpixel.com&gt;
Date:   Tue Sep 15 21:17:34 2015 +0000

    add config options for escape_slash

commit fa282334051b16df91ca097dd7304b46f3bc7719
Author: Francois Chagnon &lt;francois.chagnon@jadedpixel.com&gt;
Date:   Mon Feb 9 21:09:33 2015 +0000

    add forward slash to escape character
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Squashed commit of the following:

commit 26d181059989279a79c433cedcd893b4f52e42ee
Author: Francois Chagnon &lt;francois.chagnon@jadedpixel.com&gt;
Date:   Tue Sep 15 21:17:34 2015 +0000

    add config options for escape_slash

commit fa282334051b16df91ca097dd7304b46f3bc7719
Author: Francois Chagnon &lt;francois.chagnon@jadedpixel.com&gt;
Date:   Mon Feb 9 21:09:33 2015 +0000

    add forward slash to escape character
</pre>
</div>
</content>
</entry>
<entry>
<title>[flori/json] Typo fix</title>
<updated>2020-07-01T09:47:51+00:00</updated>
<author>
<name>Marc-Andre Lafortune</name>
<email>github@marc-andre.ca</email>
</author>
<published>2020-06-30T04:28:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=26041da2fbca4cfeffaee13b66f90310d5d72e18'/>
<id>26041da2fbca4cfeffaee13b66f90310d5d72e18</id>
<content type='text'>
https://github.com/flori/json/commit/26c1769969
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/flori/json/commit/26c1769969
</pre>
</div>
</content>
</entry>
</feed>
