Sample audits · Open-source projects, first eight

paulmillr/noble-ed25519

The ed25519 signature library behind many Solana tools.

Summary card for this audit: 9 findings after review, 0 High, 1 Medium, 3 Low, 5 Info
Auditedpaulmillr/noble-ed25519 at commit 0dd0e0e33a369bdd1079634e41f64524252f8407
Date11 October 2026 (audited again; first audit 11 October 2026)
How it ranlocal run on our workstation, full audit, Standard review
Verdict after reviewPass with notes (Fail if a High finding remains after review, otherwise Pass with notes)
0
High after review
1
Medium after review
3
Low after review
5
Info after review
0
excluded on review

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 auditFindingReviewed rating thenNowIn this audit
#1Hash provider slots mutable, process-wideInfoStill open#2
#2Point ctor / fromAffine do not validateInfoStill opennot reported again
#3Benchmark sequential onlyInfoStill open#4
#4Point.fromHex decodes before size checkInfoStill opennot reported again
#5One large moduleInfoStill open#1
#6Tests/release do not exercise built artifactInfoStill open#8
How to read this page

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)

9. Medium Legacy negative test vectors pass without ever reaching verification
First rating: Medium · Reviewed rating: Medium · Review: confirmed · new in this audit
From the report
Evidence
failed = !ed.verify(v.sig, v.msg, key.pk);
} catch (error) {
  failed = true;
Why it matters

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.

Suggested fix, not tested

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)

3. Low Test helper sets the global hash provider at import time
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence
ed.hashes.sha512 = (m) => sha512(m);
Why it matters

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.

Suggested fix, not tested

Set the provider in an explicit setup and teardown fixture, or pass it per test, instead of at module load.

5. Low Comments describe mechanisms that do not exist in this code
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence
// BASE path has blinding active (L*BASE == O): must match the naive reference
Why it matters

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.

Suggested fix, not tested

Remove or correct the three comments so they describe this module's actual behaviour.

7. Low Shared test suite silently skips large groups of tests
First rating: Low · Reviewed rating: Low · Review: confirmed · new in this audit
From the report
Evidence
export const pippenger = undefined;
export const precomputeMSMUnsafe = undefined;
export const wNAF = undefined;
Why it matters

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.

Suggested fix, not tested

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)

1. Info Single 1,100-line module holds several separable responsibilities
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#5)
Location: index.ts:1
From the report
Evidence
// 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
Why it matters

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.

Suggested fix, not tested

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.

2. Info Hash provider is process-global mutable state
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#1)
Location: index.ts:855
From the report
Evidence
const hashes = {
  sha512Async: async (message: TArg<Uint8Array>): Promise<TRet<Uint8Array>> => {
  sha512: undefined as undefined | ((message: TArg<Uint8Array>) => TRet<Uint8Array>),
Why it matters

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.

Suggested fix, not tested

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.

4. Info Benchmarks measure only warm, sequential, single-caller throughput
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#3)
From the report
Evidence
await mark('sign', () => curve.sign(msg, keys.secretKey));
await mark('verify', () => curve.verify(sig, msg, keys.publicKey));
Why it matters

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.

Suggested fix, not tested

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.

6. Info Same random-hex generator copied into three test files
First rating: Low · Reviewed rating: Info · Review: rated too high · new in this audit
From the report
Evidence
function hexa() {
  const items = '0123456789abcdef';
  return fc.integer({ min: 0, max: 15 }).map((n) => items[n]);
Why it matters

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.

Suggested fix, not tested

Move the generators into the shared test utilities (test/utils.ts) and import them.

8. Info Tests exercise the TypeScript source, not the published build
First rating: Low · Reviewed rating: Info · Review: rated too high · also in the first audit (#6)
Location: package.json:47
From the report
Evidence
"main": "index.js",
import * as ed from '../index.ts';
Why it matters

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.

Suggested fix, not tested

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.

Want this for your code?

Upload a ZIP or link a public GitHub repo, pick the areas and the depth, and get findings by severity with fixes.