You've already forked wc-licensed-product-client
Fix security vulnerabilities identified in audit
- Add JSON encoding error handling in ResponseSignature to prevent silent failures - Sanitize exception messages to prevent information disclosure - Fix header normalization to treat empty values as null - Add SSRF protection with URL validation and private IP blocking - Replace custom key derivation with RFC 5869 compliant hash_hkdf() - Add input validation in DTO fromArray() methods - Add DateTime exception handling in DTOs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,13 @@ final readonly class ActivationResult
|
||||
|
||||
public static function fromArray(array $data): self
|
||||
{
|
||||
if (!isset($data['success']) || !is_bool($data['success'])) {
|
||||
throw new \InvalidArgumentException('Invalid response: missing or invalid success field');
|
||||
}
|
||||
if (!isset($data['message']) || !is_string($data['message'])) {
|
||||
throw new \InvalidArgumentException('Invalid response: missing or invalid message field');
|
||||
}
|
||||
|
||||
return new self(
|
||||
success: $data['success'],
|
||||
message: $data['message'],
|
||||
|
||||
Reference in New Issue
Block a user