01Issue
Overview
Cryptography uses methods such as encryption, password hashing, and digital signatures to protect information. Encryption changes readable data into ciphertext that should be readable only with the right key. Hashing produces a one-way value used to check a password without storing the password itself. A digital signature can help a receiver check that data came from the holder of a signing key and was not changed. These methods solve different problems, so using the word “encrypted” does not by itself show that data is protected. TLS 1.3, for example, protects data while it travels between endpoints when configured and its certificates are correctly checked; it does not protect a copy later exposed in an application log. OWASP describes cryptographic failures as a root cause that can lead to sensitive-data exposure, which is a possible result rather than a synonym for every crypto flaw.
Common causes
- A page or service sends sensitive information over HTTP, accepts weak transport settings, or fails to verify the server certificate.
- An application uses an outdated or incorrectly configured algorithm, mode, random value, initialization vector, or nonce.
- Keys are hard-coded, committed to a repository, shared across environments, stored beside the data they protect, or left accessible to too many people.
- Passwords are stored as readable text or with a fast general-purpose hash instead of a password-hashing function designed to slow guessing.
- Sensitive values are copied into URLs, logs, analytics, exports, caches, backups, or error messages where more people or systems can read them.
- A team encrypts a database or disk but assumes this also protects data after the running application has decrypted it for normal use.
- The product collects or keeps sensitive information that it does not need.
References: OWASP Top 10: A02 Cryptographic Failures ↗OWASP Cryptographic Storage Cheat Sheet ↗OWASP Password Storage Cheat Sheet ↗OWASP Transport Layer Security Cheat Sheet ↗OWASP Key Management Cheat Sheet ↗OWASP WSTG: Testing for Weak Transport Layer Security ↗OWASP WSTG: Testing for Weak Cryptography ↗RFC 8446: TLS 1.3 ↗
02Examples
A risky design sends credentials in a URL: GET /login?username=reader&password=TEST_PASSWORD HTTP/1.1 with Host: app.example.test. If that request uses HTTP, the password is sent without transport encryption and may also be copied into browser history, proxy logs, or other URL records. A later redirect to HTTPS cannot protect the first request.
A safer request shape is POST /login HTTP/1.1 with Host: app.example.test and Content-Type: application/x-www-form-urlencoded, followed by username=reader&password=TEST_PASSWORD in the request body. The request still needs a correctly validated HTTPS connection; POST does not encrypt the body. A response such as HTTP/1.1 200 OK does not prove that the connection was protected, so verify the browser’s connection and certificate separately.
For a storage review, place a unique non-secret marker such as PROFILE-MARKER-42 in a test profile field and follow that marker through the test database, backup, log, and export. If it appears in a log that a wider group can read, that confirms exposure of that log copy. It does not show that other records, keys, or accounts were exposed.
03Impact
A sensitive value must be present in the affected flow, and a protection or access-control failure must let a person or system outside the intended audience read or change it. The route to that result matters: a network observer needs a path to the unprotected traffic, while a storage exposure depends on access to the stored copy and, for encrypted data, often the key. A weak-looking algorithm name, an encrypted database, or a value visible to its intended user is not enough to prove a vulnerability.
The result depends on which data is exposed, who can reach it, and for how long. It may include disclosure of credentials, personal information, payment or health data, business secrets, or the ability to alter information when integrity protection is missing. A compromised password database can create a risk of password guessing, but it does not prove that any account was accessed. Likewise, seeing ciphertext in a database does not show that it is safe if the application or the same compromised account can retrieve the key. OWASP gives this kind of distinction in its example where database encryption does not stop an attacker from reading data through an application query flaw.
04Testing
Test cases
1. Check sensitive information sent without encryption
Follow login and other sensitive actions in the browser or proxy. Check the actual request destination, redirects, cookies, URLs, and application logs for unprotected sensitive values.
Example: A form may open on HTTPS but send data to HTTP. Inspect the submitted request, not only the address bar.
POST /login HTTP/1.1
Host: app.example.test
Content-Type: application/x-www-form-urlencoded
username=TEST_USER&password=TEST_PASSWORD
2. Test transport security settings
Review supported TLS versions and cipher suites using a current scanner. Compare the results with current guidance and check redirects, mixed content, and HTTPS use across the full flow.
Example: A CDN and an origin can present different TLS settings. Record the hostname and port actually tested.
GET /account HTTP/1.1
Host: app.example.test
3. Check certificate signature validation
Inspect the presented certificate chain and verify signatures, trust, and hostname against a trusted certificate store. Repeat through the application client if it handles certificates itself.
Example: A certificate can be present but not trusted. A hostname mismatch is a separate validation failure.
openssl s_client -connect app.example.test:443 -servername app.example.test -verify_return_error -verify_hostname app.example.test
4. Check certificate expiry
Inspect the certificate validity dates for each public hostname and compare them with the current time. Also check intermediate certificates in the chain.
Example: A certificate may expire soon even if it is valid today. Check the leaf and the chain separately.
5. Check for a padding oracle
Where the application accepts encrypted values, compare responses to controlled changes and review the decryption and integrity checks. Repeat observations to distinguish consistent differences from noise.
Example: Different errors can be a clue. They do not alone prove that encrypted data can be recovered.
6. Review weak encryption and key handling
Review algorithms, modes, random values, key storage, and password hashing in code and configuration. Compare actual use with current platform and OWASP guidance.
Example: Finding an algorithm name in code is a lead. Check how it is used and whether it protects sensitive data.
Testing references: OWASP Top 10: A02 Cryptographic Failures ↗OWASP Cryptographic Storage Cheat Sheet ↗OWASP Password Storage Cheat Sheet ↗OWASP Transport Layer Security Cheat Sheet ↗OWASP Key Management Cheat Sheet ↗OWASP WSTG: Testing for Weak Transport Layer Security ↗OWASP WSTG: Testing for Weak Cryptography ↗RFC 8446: TLS 1.3 ↗
05Mitigation
Start by classifying data and collecting only what the feature needs; data that is never collected cannot leak from the system. Use HTTPS for sensitive traffic, configure supported TLS versions and settings, validate certificates, and redirect HTTP to HTTPS without sending sensitive fields in the initial HTTP request. Use HSTS where appropriate after HTTPS is correctly deployed. For stored data, use maintained cryptographic libraries and authenticated encryption when confidentiality and tamper detection are required. Keep keys out of source code and separate them from the data where practical; limit who and what can use them, and plan rotation and revocation. Store passwords with a maintained password-hashing function rather than reversible encryption or a fast general-purpose hash. Keep sensitive values out of URLs, logs, analytics, exports, and caches unless the feature requires them, and apply authorization independently of encryption. OWASP’s Cryptographic Storage Cheat Sheet, Password Storage Cheat Sheet, and Transport Layer Security Cheat Sheet give implementation guidance.
Retest
Repeat the same data-flow checks with test values after the change. Verify the actual public and internal TLS endpoints, certificate validation, stored records and key permissions, password-hash configuration, and the logs and exports where the marker previously appeared. Confirm unauthorized roles still cannot retrieve the data and normal application workflows continue to work. If a key or credential was exposed, treat rotation or revocation as a separate response task; changing the code alone does not invalidate an already exposed value.