
| Audited | paulmillr/noble-ed25519 at commit 0dd0e0e33a369bdd1079634e41f64524252f8407 |
|---|---|
| Date | 11 October 2026 (audited again; first audit 11 October 2026) |
| How it ran | local run on our workstation, full audit, Standard review |
| Verdict after review | Pass with notes (Fail if a High finding remains after review, otherwise Pass with notes) |
Compared with the first audit
Same commit as the first audit: the project's default branch has no later commits (checked 11 October 2026), so nothing could have been fixed upstream in between. Each finding of the first audit (11 October 2026) was checked again against the code audited now. 6 findings in the first audit; 6 still open (4 found again, 2 not reported again but still present). This audit has 9 findings after review, 5 of them new.
| First audit | Finding | Reviewed rating then | Now | In this audit |
|---|---|---|---|---|
| #1 | Hash provider slots mutable, process-wide | Info | Still open | #2 |
| #2 | Point ctor / fromAffine do not validate | Info | Still open | not reported again |
| #3 | Benchmark sequential only | Info | Still open | #4 |
| #4 | Point.fromHex decodes before size check | Info | Still open | not reported again |
| #5 | One large module | Info | Still open | #1 |
| #6 | Tests/release do not exercise built artifact | Info | Still open | #8 |
Each finding keeps the number it has in the audit report. The rating shown first is the one after review; the first automated rating is listed with it. 1 findings were first rated Medium or High; 1 of them are Medium or High after review. Text marked "From the report" is quoted from the audit report; fixes are suggestions and were not tested. Code locations link to the file and line at the audited commit.
Medium after review (1)
test/ed25519.test.ts:440From the report
failed = !ed.verify(v.sig, v.msg, key.pk);
} catch (error) {
failed = true;
v.sig, v.msg and key.pk are hex strings, but verify() accepts only byte arrays. It throws a TypeError on the first argument check (index.ts:710). The catch counts that as a correct rejection, so every "invalid" vector in this legacy test passes without the verifier running. The "valid" branch of the same test (line 436) does convert to bytes. The newer test at line 469 checks the invalid vectors only in strict mode (zip215: false). So the invalid vectors are no longer checked against the default verification mode at all. A regression that made the default verifier accept a malformed signature would not be caught here.
Wrap the inputs as the valid branch does, ed.verify(bytes(v.sig), bytes(v.msg), bytes(key.pk)). Pass the test only on a false result, or on a specific expected error, never on any exception.
Low after review (3)
test/ed25519.helpers.ts:8From the report
ed.hashes.sha512 = (m) => sha512(m);
Importing this helper changes global state, so every test file inherits a configured provider. The results then depend on import order. Tests that save and restore the "original" provider restore the value this import set, not the library's real default, which is unset. A regression in the "provider not configured" path could therefore go unnoticed.
Set the provider in an explicit setup and teardown fixture, or pass it per test, instead of at module load.
test/ed25519.test.ts:389From the report
// BASE path has blinding active (L*BASE == O): must match the naive reference
This module has no scalar blinding. The comment at test/ed25519.test.ts:379 refers to an "unblinded … path", and index.ts:175 says "Reject it like pow() and invertCt() do", but neither of those functions exists in the module. A search for these names found only these comments. Readers who trust the comments will misjudge the side-channel defences, and the code uses a variable-time inversion.
Remove or correct the three comments so they describe this module's actual behaviour.
test/point.helpers.ts:30From the report
export const pippenger = undefined;
export const precomputeMSMUnsafe = undefined;
export const wNAF = undefined;
The point and utility test files are shared with a larger sibling library. Their sections are wrapped in feature checks such as if (C.Signature), if (C.getSharedSecret) and if (extra.copyBytes), so here most of them never run and never say so. If a public API name were renamed, the tests guarding it would switch off without failing.
Remove the branches that cannot apply to this package. Or make the shared suite log or mark skipped groups explicitly, and assert the list of features this package expects to have.
Info after review (5)
index.ts:1From the report
// Helpers and Precomputes sections are reused between libraries
let Gpows: Point[] | undefined = undefined; // shared process-wide cache of base-point precomputes
export type TypedArg<T> = T extends BigInt64Array
index.ts holds the byte and hex helpers, field arithmetic, the Point class, signing and verification, the base-point precompute cache, and about 100 lines of TypeScript compatibility types. The comments say some sections are copied between sibling libraries. Copied sections in one large file are easy to let drift apart, and hard to review in isolation.
If the single-file layout is a deliberate size goal, keep it, but mark each copied section with its source and check that the copies match. Otherwise, split it into internal modules (bytes, field, point, precompute, sign/verify, types) and re-export the public API from index.ts.
index.ts:855From the report
const hashes = {
sha512Async: async (message: TArg<Uint8Array>): Promise<TRet<Uint8Array>> => {
sha512: undefined as undefined | ((message: TArg<Uint8Array>) => TRet<Uint8Array>),
Any module in the process can replace either SHA-512 slot. That silently changes how every other consumer signs and verifies. The library already checks that the digest is 64 bytes, which limits the damage, but a wrong or instrumented provider set by one dependency still affects everyone.
Keep the documented API. State clearly in the documentation that the slots are process-wide and should be set once at start-up. Consider an optional per-call or per-instance provider for callers who need isolation.
test/benchmark.ts:18From the report
await mark('sign', () => curve.sign(msg, keys.secretKey));
await mark('verify', () => curve.verify(sig, msg, keys.publicKey));
The first base-point multiplication builds a table of about 4,200 points on the calling thread. That cost lands in the init run, so no benchmark reports it as cold-start latency. No benchmark reports tail latency, and none runs many async operations at once.
Add a cold-start case on a fresh module instance. Add a concurrent case, for example Promise.all over many signAsync and verifyAsync calls, and report p50, p99 and p99.9 latencies.
test/point.test.ts:18From the report
function hexa() {
const items = '0123456789abcdef';
return fc.integer({ min: 0, max: 15 }).map((n) => items[n]);
hexa() and hexaString() are defined identically in test/point.test.ts:18, test/utils.test.ts:16 and test/ed25519.test.ts:102. If one copy is changed, the property tests start generating different inputs without anyone noticing.
Move the generators into the shared test utilities (test/utils.ts) and import them.
package.json:47From the report
"main": "index.js",
import * as ed from '../index.ts';
Users get the index.js and index.d.ts that tsc produces. Every test and the benchmark import ../index.ts directly. No compiled index.js is in the repository, and no test imports the built file. The CI workflows hand off to an external shared workflow, so we could not confirm that the build output is tested. A build-only problem, such as a compiler or target difference or a missing file in the files list, would ship without being caught.
Add a CI step that runs the suite, or at least a smoke test of sign, verify and the sync and async hash wiring, against the built index.js (ideally the packed tarball). Or confirm and document that the shared workflow already does this.