File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -7,3 +7,27 @@ These sniffs will report security vulnerabilities in your PHP code.
77This project is inspired
88by [ phpcs-security-audit] ( https://github.com/FloeDesignTechnologies/phpcs-security-audit ) ,
99a similar but no longer maintained project.
10+
11+ ## Usage
12+
13+ Run PHP_CodeSniffer with the ` Security ` standard:
14+
15+ ``` sh
16+ vendor/bin/phpcs --standard=Security /path/to/code
17+ ```
18+
19+ Example output:
20+
21+ ``` text
22+ FILE: /path/to/file.php
23+ -----------------------------------------------------------------------------------------------------------------------
24+ FOUND 6 ERRORS AFFECTING 5 LINES
25+ -----------------------------------------------------------------------------------------------------------------------
26+ 5 | ERROR | Passing user input to require_once() can lead to remote file inclusion (CWE-98)
27+ 9 | ERROR | Passing user input to shell_exec() can lead to OS command injection (CWE-78)
28+ 11 | ERROR | Outputting unsanitized user input can lead to cross-site scripting (CWE-79)
29+ 11 | ERROR | Passing user input to file_get_contents() can lead to path traversal attacks (CWE-22)
30+ 13 | ERROR | Cleartext transmission of data over HTTP is a security risk (CWE-319)
31+ 15 | ERROR | The sha1 algorithm is not safe for password hashing (CWE-916), use password_hash() for hashing passwords
32+ -----------------------------------------------------------------------------------------------------------------------
33+ ```
You can’t perform that action at this time.
0 commit comments