Test tokens
The ways a token can be wrong
Anyone can sign a token. The useful part is a curated set of ways to break one, each with the outcome your service should reach and an explanation a security reviewer will accept. No account needed to read these.
If a term below is unfamiliar, the glossary explains the vocabulary these cases are written in, and the guides cover why they are worth testing at more length than this list allows.
alg-none
A token declaring alg none and carrying no signature at all. A service that accepts it can be forged by anyone who can type. CWE-347.
expired
A correctly signed token whose exp claim is in the past. A service that accepts it is not checking expiry, so any leaked token works forever.
not-yet-valid
A correctly signed token whose nbf claim is in the future. Usually a clock difference between two machines rather than an attack.
signature-stripped
A token that claims to be signed, with the signature deleted. A service treating an absent signature as nothing to check can be forged. CWE-347.
tampered-payload
A correctly signed token whose contents were changed afterwards. The signature no longer matches the claims, which is what signing exists to catch. CWE-345.
unknown-kid
A token signed with the real key but pointing at a key id that is not published. A service that tries every key until one works is guessing. CWE-347.
valid
A correctly signed token, and the control case: if your service rejects this one, the failure cases below will not tell you much.
wrong-key
A properly signed token, signed with a key your service should not trust. Checks whether it verifies which key signed, or only that something did. CWE-347.
wycheproof-jws-alg-is-none
Algorithm none must not be accepted by default.
wycheproof-jws-json-serialization
The JWE/JWS is encoded with JSON serialization instead of compact serialization.
wycheproof-jws-modified-padding
The PKCS #1 padding of the signature has been modified.
wycheproof-jws-modified-signature
The signature has been modified.
wycheproof-jws-wrong-primitive
The signature uses a different algorithm than the algorithm specified in the key.
wycheproof-jwe-compressed-plaintext
The plaintext in this test vector has been compressed.
wycheproof-jwe-json-serialization
The JWE/JWS is encoded with JSON serialization instead of compact serialization.
wycheproof-jwe-modified-pkcs15-padding
The PKCS #1 padding has been modified. Padding errors should not be distinguishable.
wycheproof-jwe-pkcs15-with-oaep-key
The private key is an RSA-OAEP key, but the encryption uses PKCS #1.5 padding
wycheproof-jwe-wrong-cipher
A key was used with the wrong cryptographic primitive.
wycheproof-jwk-ambiguous
Marks test vectors with behavior that is not well defined by the RFCs. Best practice is to reject such cases.
wycheproof-jwk-duplicate-kid
The keyset contains multiple keys with the same kid. The test expects that such keysets are rejected.
wycheproof-jwk-mixed-key-set
The keyset contains public and private keys. The test expects that such keysets are rejected.
wycheproof-aes-cbc-hmac-ktv
Test vector from RFC 7518.
wycheproof-aes-cbc-hmac-modified-tag
The test vector contains a ciphertext with a modified tag. The test vector was obtained by manipulating a valid ciphertext. The purpose of the test is to check whether the verification fully checks the tag.
wycheproof-aes-cbc-hmac-pseudorandom
The test vector contains pseudorandomly generated inputs. The goal of the test vector is to check the correctness of the implementation for various sizes of the input parameters. Some libraries do not support all the parameter sizes. In particular the size of the IV is often restricted.
wycheproof-aes-cbc-hmac-special-case-iv
Special case iv
wycheproof-jose-json-serialization
The JWE/JWS is encoded with JSON serialization instead of compact serialization.
wycheproof-jose-json-web-keyset
The provided keys are actually JSON Web Keysets instead of single JSON Web Keys.
wycheproof-aes-eax-counter-wrap
AES-EAX reduces the counter value modulo 2^128. This test vector was constructed for testing the wrapping of the counter value.
wycheproof-aes-eax-cve-2017-18330
Overflow with large IVs
wycheproof-aes-eax-ktv
Known test vector from eprint.iacr.org/2003/069
wycheproof-aes-eax-modified-tag
The test vector contains a ciphertext with a modified tag. The test vector was obtained by manipulating a valid ciphertext. The purpose of the test is to check whether the verification fully checks the tag.
wycheproof-aes-eax-pseudorandom
The test vector contains pseudorandomly generated inputs. The goal of the test vector is to check the correctness of the implementation for various sizes of the input parameters.
wycheproof-aes-eax-small-iv
AES-EAX allows arbitrary sizes for the nonce. This test vector uses an IV smaller than 12 bytes.
wycheproof-aes-gcm-counter-wrap
The counter for GCM is reduced modulo 2**32. This test vector contains values such that the GCM counter wraps around.
wycheproof-aes-gcm-ktv
Known test vector.
wycheproof-aes-gcm-long-iv
GCM allows long IVs. Such IVs are compressed using GHASH to generate the CTR values. Some implementations restrict the range of the IV sizes.
wycheproof-aes-gcm-modified-tag
The test vector contains a ciphertext with a modified tag. The test vector was obtained by manipulating a valid ciphertext. The purpose of the test is to check whether the verification fully checks the tag.
wycheproof-aes-gcm-pseudorandom
The test vector contains pseudorandomly generated inputs. The goal of the test vector is to check the correctness of the implementation for various sizes of the input parameters. Some libraries do not support all the parameter sizes. In particular the size of the IV is often restricted.
wycheproof-aes-gcm-small-iv
GCM leaks the authentication key if the same IV is used twice. Hence short IV sizes are typically discouraged or generated with a special construction such as the one described in Section 8.2 of NIST SP 800-38d. Some libraries may reject small IV sizes.
wycheproof-aes-gcm-special-case
The test vector contains special cases for iv and tag.
Showing the first 40 of 240 matching cases. Narrow the search to see the rest.