Skip to content

Commit 275fca9

Browse files
committed
Add a secutiry note to the README.md file
This note explains why version 2.0 is not suitable for users that want to display stringified strings coming from end-users directly to them.
1 parent 83ee47e commit 275fca9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ composer require respect/stringifier
1919

2020
This library requires PHP >= 8.3.
2121

22+
## IMPORTANT: Be careful with version 2.0
23+
24+
If you are using version 2.0, please be aware of security concerns related to information leakage.
25+
26+
1. **Class/Interface/Enum Detection**: Version 2.0 would automatically detect and format strings that matched internal class, interface, or enum names. This could expose your application's internal architecture.
27+
2. **Callable String Detection**: Version 2.0 would interpret strings and arrays as callables by default, potentially exposing sensitive data. .
28+
29+
If you're not stringifiying strings coming from and end-user, you're not at risk. However, later versions changed this to a "secure-by-default" approach, assuming that strings may come from untrusted sources.
30+
2231
## Usage
2332

2433
Below a quick guide of how to use the library.

0 commit comments

Comments
 (0)