WPTT / WPThemeReview

PHP_CodeSniffer rules (sniffs) to enforce WordPress theme review coding conventions
MIT License
209 stars 37 forks source link

[New sniff] Malware/worm sniff #98

Open jrfnl opened 7 years ago

jrfnl commented 7 years ago

Rule type:

Error

Rule:

Verify a number of typical php snippets which are known as malware indicators

The list of snippets might need to be expanded. Input welcome.

Theme check file covering this rule:

https://github.com/WordPress/theme-check/blob/master/checks/worms.php

Decision needed:

A list needs to be compiled with code snippets to be sniffed for & approved by the TR board.

Notes for implementation:

To do:

dingo-d commented 4 years ago

Triage resolution: This should be added to the checks. The initial list from the theme check can be used and it can be expanded on.

@ernilambar mentioned wp-vcd.php, not sure what it is, but it can be added to the list.

ernilambar commented 4 years ago

Ref: https://www.wordfence.com/blog/2019/11/wp-vcd-the-malware-you-install-on-your-own-sites/

jrfnl commented 4 years ago

I wonder if it would be a better idea to add these sniffs to WPCS in general and then include them from WPTRT ? Or alternatively add them to the PHPCS Security standard and add sniffs from that ?

dingo-d commented 4 years ago

We are not including that standard atm, but I'm for it 👍 Anything that helps with the security is ok in my book 🙂

jrfnl commented 4 years ago

@dingo-d FYI: The Security standard needs some work (and a new release) before it could be considered for inclusion, but it's something to keep an eye on for the future for sure.

dingo-d commented 4 years ago

Do we have an estimate when this new release would be, because if it's too far in the future maybe it wouldn't be a bad thing to have this sniff either here or in the upstream (WPCS) before.

jrfnl commented 4 years ago

No release planning known to me, though I am trying to help box the project into shape, so will let you know when I know more.

Once sniffs are written for this, they can always be upstreamed later anyway (and yes: I do still think having separate sniffs for the separate threats will be a good idea).

It may also be a good idea to have a look at the Security standard already to see if sniffs already exist for some of these so energy will be spend on adding the missing ones first.