Files

428 lines
11 KiB
JSON
Raw Permalink Normal View History

{
"description": "Fixtures that the Go, Node and Python auth helpers must agree on. Each runtime's test suite loads this file and checks its own column. Change a value only together with the code that changes the behavior.",
"password": {
"plaintext": "correct horse battery staple",
"wrongPassword": "not the right password",
"hashes": [
{
"name": "Legacy PBKDF2 scheme with recorded iteration count",
"hash": "pbkdf2-sha256$600000$76add00c36dafceac62928d01f706c20$f50eec2591755f169bd151369e41a4e6918c6a2816d19516cc38763bfa63c0ca",
"verifies": {
"go": true,
"node": true,
"python": true
},
"needsUpgrade": {
"go": true,
"node": true,
"python": true
}
},
{
"name": "Legacy salt:hex PBKDF2 at 100000 iterations",
"hash": "0123456789abcdef0123456789abcdef:69a26fc4b1624cd29ecc2b2444aa876251575c65deb4af9effbd9eadbd4195c6",
"verifies": {
"go": true,
"node": true,
"python": true
},
"needsUpgrade": {
"go": true,
"node": true,
"python": true
}
},
{
"name": "Legacy PBKDF2 password over bcrypt's input limit",
"hash": "0123456789abcdef0123456789abcdef:a8a80395df31b48bfb1dc4fabb6457dc61a50aae0c8d469f618303f0cea367b2",
"password": "legacy:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"wrongPassword": "legacy:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxy",
"verifies": {
"go": true,
"node": true,
"python": true
},
"needsUpgrade": {
"go": true,
"node": true,
"python": true
}
},
{
"name": "Current bcrypt scheme with cost 12",
"hash": "bcrypt$$2b$12$NExB1DALH97MOTr6ZSUjYOb4gc.2g/uWCqbUX1d/c450damk1A9r2",
"verifies": {
"go": true,
"node": true,
"python": true
}
},
{
"name": "Go and Python, bcrypt scheme prefix, cost 4",
"hash": "bcrypt$$2b$04$swZK.9qxywaA8ezhm5aomuRTjsKm844M.p2KuaXqqp1jaK9.bnaa2",
"verifies": {
"go": true,
"node": true,
"python": true
},
"needsUpgrade": {
"go": true,
"node": true,
"python": true
}
},
{
"name": "Go and Python, unprefixed legacy bcrypt, cost 4",
"hash": "$2b$04$swZK.9qxywaA8ezhm5aomuRTjsKm844M.p2KuaXqqp1jaK9.bnaa2",
"verifies": {
"go": true,
"node": true,
"python": true
},
"needsUpgrade": {
"go": true,
"node": true,
"python": true
}
},
{
"name": "unknown scheme",
"hash": "argon2id$v=19$m=65536,t=3,p=4$c29tZXNhbHQ$YWJj",
"verifies": {
"go": false,
"node": false,
"python": false
}
},
{
"name": "plain text stored as a hash",
"hash": "correct horse battery staple",
"verifies": {
"go": false,
"node": false,
"python": false
}
},
{
"name": "empty hash",
"hash": "",
"verifies": {
"go": false,
"node": false,
"python": false
}
}
],
"tooLongToHash": {
"bytes": 73,
"accepted": {
"go": false,
"node": false,
"python": false
},
"note": "New passwords over 72 bytes are refused. Existing longer PBKDF2 passwords still verify and migrate to the marked bcrypt-sha256 scheme without truncation."
}
},
"totp": {
"secret": "GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ",
"cases": [
{
"name": "RFC 6238 T=59",
"unix": 59,
"code": "287082",
"valid": true
},
{
"name": "RFC 6238 T=1111111109",
"unix": 1111111109,
"code": "081804",
"valid": true
},
{
"name": "RFC 6238 T=1111111111",
"unix": 1111111111,
"code": "050471",
"valid": true
},
{
"name": "RFC 6238 T=1234567890",
"unix": 1234567890,
"code": "005924",
"valid": true
},
{
"name": "RFC 6238 T=2000000000",
"unix": 2000000000,
"code": "279037",
"valid": true
},
{
"name": "the next step still accepts the previous code",
"unix": 1111111139,
"code": "081804",
"matchedStep": 37037036,
"valid": true
},
{
"name": "the previous step accepts the next code",
"unix": 1111111079,
"code": "081804",
"matchedStep": 37037036,
"valid": true
},
{
"name": "two steps late is refused",
"unix": 1111111169,
"code": "081804",
"valid": false
},
{
"name": "two steps early is refused",
"unix": 1111111049,
"code": "081804",
"valid": false
},
{
"name": "a code is not a different code",
"unix": 59,
"code": "287083",
"valid": false
},
{
"name": "a code with a letter",
"unix": 59,
"code": "28708a",
"valid": false
},
{
"name": "five digits",
"unix": 59,
"code": "28708",
"valid": false
},
{
"name": "seven digits",
"unix": 59,
"code": "2870820",
"valid": false
},
{
"name": "empty code",
"unix": 59,
"code": "",
"valid": false
},
{
"name": "non-ASCII digits",
"unix": 59,
"code": "٢٨٧٠٨٢",
"valid": false
},
{
"name": "surrounding spaces are trimmed",
"unix": 59,
"code": " 287082 ",
"valid": true
},
{
"name": "secret in lower case with spaces and padding",
"unix": 59,
"code": "287082",
"secret": "gezd gnbv gy3t qojq gezd gnbv gy3t qojq====",
"valid": true
},
{
"name": "empty secret",
"unix": 59,
"code": "287082",
"secret": "",
"valid": false
},
{
"name": "secret that is not base32",
"unix": 59,
"code": "287082",
"secret": "not base32 !!",
"valid": false
}
]
},
"clientAddress": {
"note": "Go and Python only. The address is the TCP peer unless the peer is in the trusted list; then X-Forwarded-For is read from the right and trusted hops are skipped (owner decision 5).",
"invalidTrustedProxyLists": [
"not-an-ip",
"10.0.0.0/33",
"10.0.0.1, bogus"
],
"cases": [
{
"name": "no trusted proxies ignores the header",
"trusted": "",
"peer": "203.0.113.7",
"forwarded": [
"198.51.100.1"
],
"want": "203.0.113.7"
},
{
"name": "an unknown peer's header is ignored",
"trusted": "10.0.0.0/8",
"peer": "203.0.113.7",
"forwarded": [
"198.51.100.1"
],
"want": "203.0.113.7"
},
{
"name": "single client behind a trusted peer",
"trusted": "10.0.0.0/8, 172.16.0.0/12",
"peer": "10.0.0.2",
"forwarded": [
"198.51.100.9"
],
"want": "198.51.100.9"
},
{
"name": "second trusted hop is skipped",
"trusted": "10.0.0.0/8, 172.16.0.0/12",
"peer": "10.0.0.2",
"forwarded": [
"198.51.100.9, 172.16.4.4"
],
"want": "198.51.100.9"
},
{
"name": "a spoofed left-most entry is skipped",
"trusted": "10.0.0.0/8, 172.16.0.0/12",
"peer": "10.0.0.2",
"forwarded": [
"6.6.6.6, 198.51.100.9, 172.16.4.4"
],
"want": "198.51.100.9"
},
{
"name": "entries across header lines",
"trusted": "10.0.0.0/8, 172.16.0.0/12",
"peer": "10.0.0.2",
"forwarded": [
"6.6.6.6",
"198.51.100.9"
],
"want": "198.51.100.9"
},
{
"name": "a malformed entry falls back to the peer",
"trusted": "10.0.0.0/8, 172.16.0.0/12",
"peer": "10.0.0.2",
"forwarded": [
"198.51.100.9, not-an-ip"
],
"want": "10.0.0.2"
},
{
"name": "no header falls back to the peer",
"trusted": "10.0.0.0/8, 172.16.0.0/12",
"peer": "10.0.0.2",
"forwarded": [],
"want": "10.0.0.2"
},
{
"name": "every hop trusted uses the left-most",
"trusted": "10.0.0.0/8, 172.16.0.0/12",
"peer": "10.0.0.2",
"forwarded": [
"10.1.1.1, 172.16.4.4"
],
"want": "10.1.1.1"
},
{
"name": "a bare address is a one-host range",
"trusted": "192.168.1.5",
"peer": "192.168.1.5",
"forwarded": [
"198.51.100.9"
],
"want": "198.51.100.9"
},
{
"name": "an IPv6 proxy range",
"trusted": "fd00::/8",
"peer": "fd00::2",
"forwarded": [
"2001:db8::9"
],
"want": "2001:db8::9"
}
]
},
"internalSecret": {
"note": "The SECRET that gates a service's internal routes (X-Internal-Auth). Length counts characters (code points), not bytes. Every runtime reads minLength and placeholders from here.",
"minLength": 16,
"placeholders": [
"SECRET",
"change-me-to-a-long-random-value"
],
"cases": [
{
"name": "unset secret never matches",
"secret": "",
"provided": "",
"matches": false
},
{
"name": "missing header never matches",
"secret": "0123456789abcdef",
"provided": "",
"matches": false
},
{
"name": "secret one character under the minimum never matches",
"secret": "0123456789abcde",
"provided": "0123456789abcde",
"matches": false
},
{
"name": "secret at the minimum matches itself",
"secret": "0123456789abcdef",
"provided": "0123456789abcdef",
"matches": true
},
{
"name": "a prefix of the secret does not match",
"secret": "0123456789abcdef",
"provided": "0123456789abcde",
"matches": false
},
{
"name": "comparison is exact",
"secret": "0123456789abcdef",
"provided": "0123456789abcdeF",
"matches": false
},
{
"name": "length counts characters, not bytes",
"secret": "éééééééééééééééé",
"provided": "éééééééééééééééé",
"matches": true
},
{
"name": "fifteen multibyte characters are too short",
"secret": "ééééééééééééééé",
"provided": "ééééééééééééééé",
"matches": false
},
{
"name": "the example placeholder never matches",
"secret": "change-me-to-a-long-random-value",
"provided": "change-me-to-a-long-random-value",
"matches": false
},
{
"name": "the bare variable name never matches",
"secret": "SECRET",
"provided": "SECRET",
"matches": false
}
]
}
}