aaugustyniak/params-codec-bundle
Symfony 2/3 bundle that AES-encrypts route parameters. Adds a param_codec service and Twig helpers to generate encrypted URLs, plus a @DecryptParams annotation to automatically decrypt controller arguments using a secret passphrase.
/profile/abc123) while securely mapping to internal identifiers (e.g., user_id=42). Reduces risk of reverse-engineering or parameter tampering.Adopt When:
/user/123 where 123 is a database ID or token).Look Elsewhere If:
parameters.yml key; consider AWS KMS or HashiCorp Vault for dynamic keys)./profile/{slug} with a slug service).?id=encrypted_123).FOSJsRoutingBundle for client-side URL generation."This bundle lets us securely hide sensitive data in URLs—like user IDs or tokens—without exposing them in logs, browser history, or referrer headers. For example, instead of /account/42, we’d show /account/abc123, where abc123 is encrypted. This reduces compliance risk (e.g., GDPR) and prevents attackers from scraping internal identifiers. The MIT license and minimal overhead make it a low-risk, high-reward addition for [target use case, e.g., patient records or payment links]."
*"The ParamsCodecBundle provides a drop-in solution for AES-encrypting Symfony route parameters using a static key from parameters.yml. Key benefits:
/order/encrypted_123 instead of /order/550e8400-e29b-41d4-a716-446655440000).path()/url() functions via a Twig extension and annotations (@DecryptParams).password_hash() instead) or dynamic key rotation (consider Vault/KMS for that).Proposal:
composer.json and AppKernel.php.secret_passphrase in parameters.yml.@DecryptParams) or use Twig functions for encrypted URLs.
Risk: Low—MIT license, no dependents, but test with Symfony 2/3 only. For Symfony 4+, we’d need to validate or fork."**"This addresses URL-based data leakage by encrypting route parameters with AES-128/256. Key considerations:
parameters.yml key is not ideal for production—recommend rotating it via CI/CD or integrating with a secrets manager (e.g., HashiCorp Vault).stof/doctrine-extensions for signed URLs.
Approval Ask: Sign off on the static key approach for MVP, with a plan to migrate to dynamic keys in v2."*How can I help you explore Laravel packages today?