nextcloud/lib/private/Security
Anna Larch 0cff2cdbaf fix(security): don't propagate ValueError from Crypto::decrypt() fallback
When decrypting a v3 ciphertext with a mismatched secret, the first
attempt throws an Exception (HMAC mismatch). The fallback then calls
decryptWithoutSecret() with an empty string, which causes hash_hkdf()
to throw a ValueError. Since ValueError extends \Error rather than
\Exception, it bypassed the catch block and propagated as an unhandled
error, crashing the whole request.

Wrap the fallback in its own try/catch(\Throwable) and rethrow the
original Exception so callers get a meaningful HMAC mismatch error.

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 13:15:10 +00:00
..
Bruteforce fix(bfp): Trim meta data so it can still be stored 2025-10-22 15:45:21 +02:00
CSP chore(deps): Update nextcloud/coding-standard to v1.3.1 2024-09-19 14:21:20 +02:00
CSRF chore: Add SPDX header 2024-05-24 13:11:22 +02:00
FeaturePolicy chore: Add SPDX header 2024-05-24 13:11:22 +02:00
IdentityProof feat: Add option to update the public key of a user 2025-11-19 10:51:43 +01:00
Ip fix(bruteforce): limit appconfig lazy loading 2025-07-20 00:49:11 -01:00
Normalizer fix(IpNormalizer): Added inet_pton() check before bitwise operations 2025-12-16 15:06:59 +01:00
RateLimiting fix: log requests exceeding the rate limiting 2025-05-14 12:23:40 +02:00
Signature feat(signed-request): moving out of unstable 2026-01-09 20:16:24 -01:00
VerificationToken chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
Certificate.php refactor: use logical && || instead of weak and or operators 2025-09-27 23:02:18 +02:00
CertificateManager.php feat(CertificateManager): Add option to specify the default certificates bundle path 2025-12-01 10:47:23 +01:00
CredentialsManager.php chore(db): Apply query prepared statements 2024-10-17 20:30:47 +02:00
Crypto.php fix(security): don't propagate ValueError from Crypto::decrypt() fallback 2026-06-09 13:15:10 +00:00
Hasher.php fix: also respect max value for hashingThreads 2026-05-20 11:51:15 +00:00
RemoteHostValidator.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
SecureRandom.php style: update codestyle for coding-standard 1.2.3 2024-08-25 19:34:58 +02:00
TrustedDomainHelper.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00