Skip to content

Commit cdc5769

Browse files
committed
Fix Plugin Check findings
- Mark the Fluent Forms raw data read as intentionally unsanitized; the attestation is HMAC-verified and the extracted value is sanitized - Exclude .DS_Store from the distributed build
1 parent 2404d57 commit cdc5769

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.distignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
.distignore
99
README.md
1010
languages/.build
11+
.DS_Store

includes/integrations/class-captchaapi-fluent-forms.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ public function verify($errors)
5959
*/
6060
private function posted_attestation(): string
6161
{
62-
// phpcs:disable WordPress.Security.NonceVerification.Missing
62+
// The attestation is its own HMAC proof, so it needs no nonce, and the
63+
// value pulled out of the parsed string is sanitized before use.
64+
// phpcs:disable WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
6365
if (empty($_POST['data'])) {
6466
return '';
6567
}
6668

6769
parse_str(wp_unslash($_POST['data']), $parsed);
68-
// phpcs:enable WordPress.Security.NonceVerification.Missing
70+
// phpcs:enable WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
6971

7072
return isset($parsed['captcha_attestation']) ? sanitize_text_field((string) $parsed['captcha_attestation']) : '';
7173
}

0 commit comments

Comments
 (0)