Skip to content

Commit c0d0d1e

Browse files
authored
Improved security notice (#231)
1 parent 3134923 commit c0d0d1e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fast-json-stringify obj x 13,537,123 ops/sec ±0.19% (95 runs sampled)
4141
- <a href="#ref">`Reuse - $ref`</a>
4242
- <a href="#long">`Long integers`</a>
4343
- <a href="#nullable">`Nullable`</a>
44-
- <a href="#caveat">`Caveat`</a>
44+
- <a href="#security">`Security Notice`</a>
4545
- <a href="#acknowledgements">`Acknowledgements`</a>
4646
- <a href="#license">`License`</a>
4747

@@ -540,15 +540,17 @@ Otherwise, instead of raising an error, null values will be coerced as follows:
540540
- `string` -> `""`
541541
- `boolean` -> `false`
542542
543-
<a name="caveat"></a>
544-
## Caveat
543+
<a name="security"></a>
544+
## Security notice
545+
546+
Treat the schema definition as application code, it
547+
is not safe to use user-provided schemas.
545548
546549
In order to achieve lowest cost/highest performance redaction `fast-json-stringify`
547550
creates and compiles a function (using the `Function` constructor) on initialization.
548-
While the `schema` is currently validated for any developer errors, it's recommended against
549-
allowing user input to directly supply a schema.
550-
It can't be guaranteed that allowing user input for the schema couldn't feasibly expose an attack
551-
vector.
551+
While the `schema` is currently validated for any developer errors,
552+
there is no guarantee that supplying user-generated schema could not
553+
expose your application to remote attacks.
552554
553555
<a name="debug"></a>
554556
### Debug Mode

0 commit comments

Comments
 (0)