Skip to content

Commit c7a7b2b

Browse files
committed
Add a security note in README
1 parent ab6c8f2 commit c7a7b2b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,17 @@ There are also the methods `Kernel#j` for generate, and `Kernel#jj` for
249249
`pretty_generate` output to the console, that work analogous to Core Ruby's `p` and
250250
the `pp` library's `pp` methods.
251251

252+
## Security
253+
254+
When parsing or serializing untrusted input, parser and generator options should never be user controlled.
255+
256+
```ruby
257+
# Dangerous, DO NOT DO THIS.
258+
JSON.generate(params[:data], params[:options])
259+
```
260+
261+
Security vulnerability reports relying on attacker controlled parsing or generator options will be handled as regular bug fixes.
262+
252263
## Development
253264

254265
### Prerequisites

0 commit comments

Comments
 (0)