Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add phpinfo() to dangerous calls config #255

Merged
merged 1 commit into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions disallowed-dangerous-calls.neon
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@ parameters:
message: 'use some logger instead'
allowParamsAnywhere:
2: true
-
function: 'phpinfo()'
message: 'might reveal session id or other tokens in cookies'
errorTip: 'see https://www.michalspacek.com/stealing-session-ids-with-phpinfo-and-how-to-stop-it and use e.g. spaze/phpinfo instead'
1 change: 1 addition & 0 deletions tests/Configs/DangerousConfigFunctionCallsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function testRule(): void
['Calling var_dump() is forbidden, use some logger instead.', 22],
['Calling var_export() is forbidden, use some logger instead.', 23],
['Calling var_export() is forbidden, use some logger instead.', 25],
['Calling phpinfo() is forbidden, might reveal session id or other tokens in cookies.', 26, 'see https://www.michalspacek.com/stealing-session-ids-with-phpinfo-and-how-to-stop-it and use e.g. spaze/phpinfo instead'],
]);
}

Expand Down
1 change: 1 addition & 0 deletions tests/src/configs/dangerousCalls.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
var_export([]);
var_export([1], true);
var_export([2], false);
phpinfo();
Loading