fix(deps): update dependency altcha-lib to v2 #162
No reviewers
Labels
No labels
bug
duplicate
enhancement
future
help wanted
invalid
question
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/TeaLeaves!162
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/altcha-lib-2.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
^1.2.0→^2.0.0Release Notes
altcha-org/altcha-lib (altcha-lib)
v2.8.0Compare Source
Fixed
altcha-lib/frameworks/h3works with h3 v1 (Nuxt 4, Nitro 2) as well as h3 v2 (Nitro 3), and theh3peer dependency accepts^1.15.0 || ^2.0.0(#22). The plugin no longer importsh3at runtime, so it no longer fails withevent.req.headers.get is not a functionwhen the package manager installs h3 v2 foraltcha-libnext to Nuxt's h3 v1.altcha-lib/frameworks/h3middleware leaves the request body readable for later handlers on both h3 majors.altcha-lib/frameworks/h3errors (403 on failed verification, 400 on an invalid JSON or form data body) are recognized as HTTP errors by both h3 v1 and v2. h3 v1 previously treated them as unhandled errors.docs/nuxt.md: route files live underserver/routes/, imports use~~/server/...(Nuxt 4's~points toapp/), and the example usescreateError, which exists in h3 v1 and v2.Changed
tsconfig.cjs.jsonsetsignoreDeprecations: "6.0"to keepmoduleResolution: "node"for the CommonJS build, which TypeScript 6 deprecates and TypeScript 7 removes.v2.7.0Compare Source
Fixed
@sveltejs/kitpeer dependency accepts^2.0.0 || ^3.0.0, so npm no longer fails withERESOLVEin SvelteKit 3 projects (#21).altcha-lib/frameworks/sveltekitno longer importsHandlefrom@sveltejs/kit, which SvelteKit 3 moved to@sveltejs/kit/hooks.Changed
altcha-lib/frameworks/sveltekitis ESM-only, like@sveltejs/kit. The CommonJS build could not be loaded because@sveltejs/kitcannot berequire()d;require('altcha-lib/frameworks/sveltekit')now fails withERR_PACKAGE_PATH_NOT_EXPORTEDforaltcha-libinstead.altcha-lib/frameworks/sveltekitresponds withResponse.jsoninstead of SvelteKit'sjsonhelper, which SvelteKit 3 deprecates.v2.6.0Compare Source
Security
createChallengeno longer publishes the whole derived key whenkeyPrefixLengthis at least the key length. Before, a challenge withhmacKeySignatureSecretcould be verified without any work by submitting the publishedkeyPrefixas the solution.obfuscate()no longer exposes its AES key whenkeyPrefixLengthis passed in its options.createChallengeno longer creates challenges with an emptykeyPrefix(for example withkeyLength: 1,keyPrefixLength: 0orkeyPrefix: ''), which any counter solved.idinside the signedverificationDatainstead of the unsigned top-levelid, which could be changed or removed to replay a payload.CappedMap(allowing replays), or mark another user's challenge as used.verifyServerSignaturevalidatespayload.algorithm(not covered by the signature) before use. It accepts onlySHA-1,SHA-256,SHA-384andSHA-512.__proto__key in challenge parameters is now covered by the signature. Before, it was dropped from the signed JSON, so it could be injected into a signed challenge.Fixed
altcha-lib/algorithms/web/sha) produces the same keys as the Node version. They differed for SHA-384 and SHA-512 with the defaultkeyLength32 andcost> 1, and for anykeyLengthbelow the digest size.altcha-lib/algorithms/web/pbkdf2) supports anykeyLength, not only 16, 24 and 32.verifySolutionreturnsinvalidSolutioninstead of throwing for a malformed solution: aderivedKeythat is missing or not lowercase hex, or a missingsolution. Both verification paths now reject an uppercasederivedKey(the key-signature path used to accept it).verifySolutionreturnsinvalidSolutionfor a counter that is not an exact integer in range. Before,"42"and2 ** 32 + 42verified as42.solveChallengethrows immediately for an invalidkeyPrefixinstead of searching until the timeout.keyPrefix(for example from another library) can be solved and verified.verifyServerSignaturereturnsinvalidSignatureinstead of throwing whenpayload.signatureis missing.verifyServerSignaturetreats a payload as expired as soon as the current time passesexpire, the same asverifySolution. Before, it allowed up to 1 second of grace.create --algorithmis case-insensitive and rejects unsupported names. Before, a lowercase name created a challenge thatsolvecould not solve.createdefaults toPBKDF2/SHA-256, as documented. It usedSHA-256.Added
Store.setIfAbsent(key, value): optional atomic check-and-set. When a store implements it, the framework plugins use it, so only one of two concurrent submissions of the same payload passes.CappedMapimplements it;docs/store.mdshows a Redis implementation withSET … NX.docs/advanced-usage.mddocuments the challenge signature format (canonical JSON) for other implementations.docs/server-signatures.mddocuments the expiry rules and how to checkfieldsHashwithverifyFieldsHash.Changed
createChallengevalidates its options and throws for invalid values:keyPrefixLengthmust be a positive integer smaller than the derived key length. Values above half the derived key are capped at half. The default isfloor(keyLength / 2). With SHA-256 andkeyLength: 64, the default now throws in counter mode, because the derived key is only 32 bytes.keyPrefixmust be a non-empty hex string no longer than the key. It is lowercased before signing.countermust be an integer from 0 to 2^32 - 1 ('uint32') orNumber.MAX_SAFE_INTEGER('string').costandkeyLengthmust be positive integers, and so mustmemoryCostandparallelismwhen set.counterModemust be'uint32'or'string'.expiresAtmust be a validDateor a positive number of seconds.hmacAlgorithmmust beSHA-256,SHA-384orSHA-512.createChallengethrows for an empty ornullhmacSignatureSecret, and forhmacKeySignatureSecretwithouthmacSignatureSecret(it used to be ignored). OmittinghmacSignatureSecretstill creates an unsigned challenge.verifySolutionthrows for a missing or emptyhmacSignatureSecret.verifyServerSignaturethrows for a missing or emptyhmacSecret.deriveKeyfunctions accept only their exact algorithm names and throw otherwise:SHA-256,SHA-384,SHA-512;PBKDF2/SHA-256,PBKDF2/SHA-384,PBKDF2/SHA-512;SCRYPT;ARGON2ID. The Node functions used to fall back to SHA-256 for unknown names, and scrypt and Argon2id ignored the name. The scrypt and Argon2id functions requirememoryCost.verifySolutionandverifyServerSignaturethrow for an unsupportedhmacAlgorithmorpayload.algorithm. The framework plugins return the error as a failed verification.challengeHandlers fail with a configuration error whenhmacSignatureSecretis not set, instead of issuing unsigned challenges that their ownverifyrejects.idinverificationDataare rejected. Sentinel always includes it.v2.5.0Compare Source
Added
v2.4.0Compare Source
Fixed
registerAsynctyping (#19).v2.3.2Compare Source
Fixed
keyPrefixin PoW v2 fallback verification.v2.3.1Compare Source
Fixed
verifyHandler(the standalone/verifyendpoint, meant for custom or external integrations) calledverifyServerwhen averifyServeroption was configured.v2.3.0Compare Source
Added
verifyServer()verifies a payload remotely through ALTCHA Sentinel'sPOST /v1/verify/signatureAPI instead of checking the HMAC signature locally. It supports timeouts, retries with fixed or exponential backoff, a customfetch, and aborting through anAbortController.verifyServeroption. When it is set, Sentinel-issued payloads are verified remotely through the existingverifyHandlerand middleware.Changed
hmacSignatureSecret,deriveKeyandcreateChallengeParametersare optional in the framework plugin options, so a Sentinel-only setup can becreate({ verifyServer: { url, secret } }). CallingchallengeHandlerwithoutderiveKeyorcreateChallengeParametersfails with a configuration error.v2.2.0Compare Source
Fixed
Cache-Control: no-storeheader (#17).v2.1.0Compare Source
Fixed
throwOnFailureis set (#16).v2.0.3Compare Source
v2.0.2Compare Source
v2.0.1Compare Source
Added
Fixed
solveChallengeyielding and abort.v2.0.0Compare Source
Fixed
altcha-lib/frameworks/h3works with h3 v1 (Nuxt 4, Nitro 2) as well as h3 v2 (Nitro 3), and theh3peer dependency accepts^1.15.0 || ^2.0.0(#22). The plugin no longer importsh3at runtime, so it no longer fails withevent.req.headers.get is not a functionwhen the package manager installs h3 v2 foraltcha-libnext to Nuxt's h3 v1.altcha-lib/frameworks/h3middleware leaves the request body readable for later handlers on both h3 majors.altcha-lib/frameworks/h3errors (403 on failed verification, 400 on an invalid JSON or form data body) are recognized as HTTP errors by both h3 v1 and v2. h3 v1 previously treated them as unhandled errors.docs/nuxt.md: route files live underserver/routes/, imports use~~/server/...(Nuxt 4's~points toapp/), and the example usescreateError, which exists in h3 v1 and v2.Changed
tsconfig.cjs.jsonsetsignoreDeprecations: "6.0"to keepmoduleResolution: "node"for the CommonJS build, which TypeScript 6 deprecates and TypeScript 7 removes.Configuration
📅 Schedule: (in timezone America/Chicago)
* 0-3 * * 1)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.
0af2c6fb4d31d64885ab31d64885ab74947ee09d74947ee09d82a60a933382a60a933379dc361c5c79dc361c5c732a00420cView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.