Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call. The issues lies in using strdup in ext/json/ext/generator/generator.c, which will stop after encountering a '\0' byte, returning a pointer to a string of length zero, which is not the length stored in space_len.
2017-08-31T17:29:00.183
2025-04-20T01:37:25.860
Deferred
CVSSv3.0: 9.8 (CRITICAL)
AV:N/AC:L/Au:N/C:P/I:P/A:P
10.0
6.4
Type | Vendor | Product | Version/Range | Vulnerable? |
---|---|---|---|---|
Application | ruby-lang | ruby | ≤ 2.2.7 | Yes |
Application | ruby-lang | ruby | 2.3.0 | Yes |
Application | ruby-lang | ruby | 2.3.0 | Yes |
Application | ruby-lang | ruby | 2.3.0 | Yes |
Application | ruby-lang | ruby | 2.3.1 | Yes |
Application | ruby-lang | ruby | 2.3.2 | Yes |
Application | ruby-lang | ruby | 2.3.3 | Yes |
Application | ruby-lang | ruby | 2.3.4 | Yes |
Application | ruby-lang | ruby | 2.4.0 | Yes |
Application | ruby-lang | ruby | 2.4.0 | Yes |
Application | ruby-lang | ruby | 2.4.0 | Yes |
Application | ruby-lang | ruby | 2.4.0 | Yes |
Application | ruby-lang | ruby | 2.4.0 | Yes |
Application | ruby-lang | ruby | 2.4.1 | Yes |
Operating System | debian | debian_linux | 8.0 | Yes |
Operating System | debian | debian_linux | 9.0 | Yes |
Operating System | canonical | ubuntu_linux | 14.04 | Yes |
Operating System | canonical | ubuntu_linux | 16.04 | Yes |
Operating System | canonical | ubuntu_linux | 17.10 | Yes |
Operating System | redhat | enterprise_linux_desktop | 7.0 | Yes |
Operating System | redhat | enterprise_linux_server | 7.0 | Yes |
Operating System | redhat | enterprise_linux_server_aus | 7.4 | Yes |
Operating System | redhat | enterprise_linux_server_aus | 7.6 | Yes |
Operating System | redhat | enterprise_linux_server_eus | 7.4 | Yes |
Operating System | redhat | enterprise_linux_server_eus | 7.5 | Yes |
Operating System | redhat | enterprise_linux_server_eus | 7.6 | Yes |
Operating System | redhat | enterprise_linux_server_tus | 7.4 | Yes |
Operating System | redhat | enterprise_linux_server_tus | 7.6 | Yes |
Operating System | redhat | enterprise_linux_workstation | 7.0 | Yes |