WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
270 stars 53 forks source link

Create Nonce_Verification_Check #21

Closed mehulkaklotar closed 5 months ago

mehulkaklotar commented 2 years ago

Description

Checks that nonce verification functions are used within form processing. This is a security check that ensures that core nonce functions are being used to verify the request to the server before processing. This will use the existing WordPress.Security.NonceVerification sniff in the WordPress Coding Standards.

Acceptance Criteria

Tests Coverage

vishalkakadiya commented 1 year ago

@felixarntz I have updated AC for this epic. It is ready for review now. Thanks!

ernilambar commented 11 months ago

Looks like XML file has this ruled enabled already.

    <!-- Nonces. These are triggered on any GET/POST access items. -->
    <rule ref="WordPress.Security.NonceVerification">
      <!-- This is triggered on all GET/POST access, it can't be an error. -->
      <type>warning</type>
    </rule>

When I try to add separate check for this rule WordPress.Security.NonceVerification is displaying duplicate messages for same errors. Are we planning to create separate Check for this and remove the rule from XML file? Can someone please elaborate?

swissspidy commented 5 months ago

There are already WordPress.Security.NonceVerification.Missing errors being reported as part of the plugin_review_phpcs / Plugin_Review_PHPCS_Check check. No need to create a separate duplicate check for this.

So this is already WAI.