You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ It currently has core PHP rules as well as Drupal 7 specific rules.
22
22
23
23
The tool also checks for CVE issues and security advisories related to the CMS/framework. This enables you to follow the versioning of components during static code analysis.
24
24
25
-
The main reason for this project being an extension of PHP_CodeSniffer is to have easy integration into continuous integration systems. It also allow for finding security bugs that are not detected with some object oriented analysis (such as [PHPMD](http://phpmd.org/)).
25
+
The main reason for this project being an extension of PHP_CodeSniffer is to have easy integration into continuous integration systems. It also allows for finding security bugs that are not detected with some object oriented analysis (such as [PHPMD](http://phpmd.org/)).
26
26
27
27
phpcs-security-audit in its beginning was backed by Pheromone (later on named Floe design + technologies) and written by [Jonathan Marcil](https://twitter.com/jonathanmarcil).
28
28
@@ -57,26 +57,26 @@ Usage
57
57
58
58
Simply set the standard to `Security` or point to any XML ruleset file and to a folder to scan:
6 | ERROR | Easy XSS detected because of direct user input with $_POST on echo
75
-
8 | WARNING | db_query() is deprecated except when doing a static query
76
-
8 | WARNING | db_query() is deprecated except when doing a static query
77
-
8 | ERROR | Potential SQL injection found in db_query()
78
-
8 | ERROR | Potential SQL injection found in db_query()
79
-
9 | WARNING | Usage of preg_replace with /e modifier is not recommended.
74
+
6 | WARNING | Possible XSS detected with . on echo
75
+
6 | ERROR | Easy XSS detected because of direct user input with $_POST on echo
76
+
9 | WARNING | Usage of preg_replace with /e modifier is not recommended.
77
+
10 | WARNING | Usage of preg_replace with /e modifier is not recommended.
78
+
10 | ERROR | User input and /e modifier found in preg_replace, remote code execution possible.
79
+
11 | ERROR | User input found in preg_replace, /e modifier could be used for malicious intent.
80
80
...
81
81
```
82
82
@@ -176,7 +176,7 @@ As with any security tool, this one comes with it's share of annoyance. At first
176
176
177
177
* It's a generator of false positives. This can actually help you learn what are the weak functions in PHP. Paranoia mode will fix that by doing a major cut-off on warnings when set to 0.
178
178
* This tool was created around 10 years ago. Some of its parts might look outdated, and support for old PHP code will still be present. The reality is that many code base scanned with it might be as old as the tool.
179
-
* It's slow. On big Drupal modules and core it can take too much time (and RAM, reconfigure `cli/php.ini` to use 512M if needed) to run. Not sure if it's because of bugs in PHPCS or this set of rules, but will be investigated last. Meanwhile you can configure PHPCS to ignore big contrib modules (and run another instance of PHPCS for `.info` parsing only for them). An example is og taking hours, usually everything runs under 1-2 minutes and sometimes around 5 minute. You can try using the `--parallel=8` (or another number) option to try and speed things up on supported OSes. Possible workaround is to use `phpcs --ignore=folder` to skip scanning of those parts.
179
+
* It's slow. On big Drupal modules and core it can take too much time (and RAM, reconfigure `cli/php.ini` to use 512M if needed) to run. Not sure if it's because of bugs in PHPCS or this set of rules, but will be investigated last. Meanwhile you can configure PHPCS to ignore big contrib modules (and run another instance of PHPCS for `.info` parsing only for them). An example is og taking hours, usually everything runs under 1-2 minutes and sometimes around 5 minute. You can try using the `--parallel=8` (or another number) option to try and speed things up on supported OSes. Possible work-around is to use `phpcs --ignore=folder` to skip scanning of those parts.
180
180
* For Drupal advisories checking: a module with multiple versions might be secure if a lesser fixed version exists and you'll still get the error or warning. Keep everything updated at latest as recommended on Drupal's website.
0 commit comments