security: validate billing address structure in Order model #12
Labels
No labels
P1
P2
P3
PHP
agent-ready
bug
clotho
discovery
docs
refactor
review
security
testing
athena
athena-gemini
audit
clotho
clotho-gemini
codex
darbs-claude
security
wiki
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: core/php-commerce#12
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Issue
Per TODO.md (P1 line 33),
Order::create()acceptsbilling_addressarray without validating structure. Malformed addresses could cause PDF generation issues or tax calculation failures.Current Behavior
The
billing_addressJSON column accepts any array structure without validation:Risk
line1,city,postcodecould break invoice PDF renderingTaxServicemay expect specific country/region fieldsRequired Fix
Add validation for billing_address structure:
Files to Update
Models/Order.php- Add$castswith validation or custom setterServices/CommerceService.php- Validate increateOrder()methodControllers/Api/CommerceController.php- Add validation rulesPriority
P1 - Critical: Required before production launch to prevent runtime errors.
Created by discovery scan (issue #2) - References TODO.md P1