1.7.1: security fixes for the checkout and the client IP #3

Merged
kw merged 1 commits from shipping-only into main 2026-11-14 14:32:42 +00:00
Owner

Security review of the plugin (family-wide request). Four fixes, each with a smoke assertion and a planted-fault control that turned it red:

  • Discount follows the billing email (order address); the tracked session email used to win, so a guest could post a discounted address and check out under their own.
  • Shipping packages carry the matched assignment, so WooCommerce rate cache no longer reuses free/reserved rates after the email changes.
  • Anonymous tracking endpoint no longer returns matched: true|false (enumeration oracle).
  • CF-Connecting-IP trusted only from Cloudflare ranges or private/loopback proxies (was: from anyone -> REST rate limit bypass, forged audit IPs).

Local: static green, selftest 61/61, site-test 89/89 on WP 7.1.4 + WC 11.3.0.

🤖 Generated with Claude Code

Security review of the plugin (family-wide request). Four fixes, each with a smoke assertion and a planted-fault control that turned it red: - Discount follows the billing email (order address); the tracked session email used to win, so a guest could post a discounted address and check out under their own. - Shipping packages carry the matched assignment, so WooCommerce rate cache no longer reuses free/reserved rates after the email changes. - Anonymous tracking endpoint no longer returns matched: true|false (enumeration oracle). - CF-Connecting-IP trusted only from Cloudflare ranges or private/loopback proxies (was: from anyone -> REST rate limit bypass, forged audit IPs). Local: static green, selftest 61/61, site-test 89/89 on WP 7.1.4 + WC 11.3.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kw added 1 commit 2026-11-14 14:23:56 +00:00
1.7.1: security fixes for the checkout and the client IP
CI / WordPress latest + WooCommerce latest on PHP 8.3 (pull_request) Successful in 1m14s
Compatibility / WP latest / WC latest / PHP 7.4 (pull_request) Skipped
Compatibility / WP latest / WC beta / PHP 8.3 (pull_request) Skipped
Compatibility / WP latest / WC latest / PHP 8.3 (pull_request) Skipped
Compatibility / WP nightly / WC latest / PHP 8.3 (pull_request) Skipped
Compatibility / WP latest / WC latest / PHP 8.4 (pull_request) Skipped
Compatibility / Keep the compatibility headers honest (pull_request) Skipped
CI / Static checks (pull_request) Successful in 4m34s
d5d85612bd
- The discount follows the billing email, the address the order is
  placed under. The tracked session email used to win, so a guest could
  post a discounted address to the tracking endpoint and check out under
  their own, keeping the discount.
- Shipping packages carry the matched assignment, so WooCommerce's
  per-package rate cache no longer reuses rates filtered for a matched
  address (free shipping, reserved methods) after the email changes.
- The anonymous tracking endpoint no longer answers matched: true|false,
  which let anyone enumerate discounted addresses and domains.
- CF-Connecting-IP is believed only from a Cloudflare edge range or a
  private/loopback proxy. From anyone else it let a direct client pick a
  new address per request: no REST rate limit, forged audit-log IPs.

Smoke tests: 89 assertions (was 73), each fix with its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
kw merged commit b9d8611ce2 into main 2026-11-14 14:32:42 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kw/nolimit-discounts#3