keboola/object-encryptor
Keboola Object Encryptor is a PHP library for encrypting and decrypting arbitrary PHP data such as arrays and objects. It wraps OpenSSL-backed encryption with configurable key handling, helping Laravel and standalone PHP applications protect sensitive data at rest with minimal integration effort.
openssl_encrypt + serialize() wrappers. A hand-rolled equivalent would almost certainly ship the same unserialize() flaw, and we would not have a CVE-style patch stream to consume.Crypt or sodium_crypto_secretbox).Adopt when:
Crypt facade — e.g., shared libraries, workers, or Keboola-ecosystem jobs where a framework-agnostic encryptor is needed.Look elsewhere when:
Crypt::encryptString() / encrypt() already covers this with authenticated encryption and key rotation via APP_KEY; adding a second crypto library increases surface area for no gain.Mandatory pre-upgrade validation for 2.14.2: allowed_classes => false means any decrypted payload containing objects will now yield __PHP_Incomplete_Class instead of a hydrated object. Run a payload-shape audit: sample real ciphertexts and confirm they decode to scalars/arrays only. If we legitimately encrypt objects, this patch is behaviour-breaking for us despite the "backward compatible" note, and we need an allow-list wrapper or a migration to array payloads before bumping. That audit is the only real work item here.
To executives / risk owners (30 seconds): A security patch shipped for a crypto library we use to protect stored data; the flaw would have let a maliciously crafted encrypted payload instantiate arbitrary classes in our process — a stepping stone to remote code execution in the worst case. The fix is a one-line version bump, requires no re-encryption, no downtime, and no change to stored data. It closes a finding that would otherwise appear in customer security reviews. Cost: a few engineering hours, mostly verification. Recommendation: approve and ship this sprint.
To engineering leadership: Upgrade keboola/object-encryptor to ^2.14.2. Zero API changes, zero format changes, existing secrets decrypt unchanged — but unserialize() now runs with allowed_classes => false, so any code path that legitimately round-trips PHP objects through the encryptor will start receiving __PHP_Incomplete_Class. The single action item is a payload-shape audit of production ciphertexts; if all payloads are arrays/scalars, this is a clean merge. Add a regression test that asserts non-scalar object payloads are either rejected or explicitly allow-listed.
Ask: one engineer-day (bump + audit + test), and a standing rule that security patch releases in this dependency are auto-merged within 7 days rather than batched into a quarterly upgrade.
How can I help you explore Laravel packages today?