@tinfoilsh/verifier 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,16 +2,7 @@
2
2
 
3
3
  Browser-compatible TypeScript library for verifying AMD SEV-SNP attestation reports and Sigstore code provenance.
4
4
 
5
- ## When to Use This Package
6
-
7
- **Most users should use the main `tinfoil` package instead.** It includes this verifier and handles verification automatically.
8
-
9
- Use `@tinfoilsh/verifier` directly when you need:
10
-
11
- - **Standalone verification** — Verify enclaves without making API requests
12
- - **Custom verification flows** — Verify before creating clients, or verify arbitrary enclaves
13
- - **Lighter dependency** — If you only need verification, not the full SDK
14
- - **Audit/compliance tooling** — Build tools that verify enclaves independently
5
+ **Most users should use the main [`tinfoil`](https://www.npmjs.com/package/tinfoil) package instead.** It includes this verifier and runs it automatically. Use this package directly for standalone verification, custom verification flows, or audit tooling.
15
6
 
16
7
  ## Installation
17
8
 
@@ -33,120 +24,19 @@ const attestation = await verifier.verify();
33
24
  console.log(attestation.measurement);
34
25
  console.log(attestation.tlsPublicKeyFingerprint);
35
26
  console.log(attestation.hpkePublicKey);
36
- ```
37
-
38
- ## Verifying a Pre-Fetched Bundle
39
-
40
- If you already have a complete attestation bundle (for example, fetched via the
41
- `tinfoil` SDK's `fetchAttestationBundle()` helper), you can verify it directly:
42
-
43
- ```typescript
44
- import { Verifier } from '@tinfoilsh/verifier';
45
- import type { AttestationBundle } from '@tinfoilsh/verifier';
46
-
47
- const verifier = new Verifier({
48
- configRepo: 'tinfoilsh/confidential-model-router',
49
- });
50
-
51
- const bundle: AttestationBundle = /* fetch bundle from your source */;
52
- await verifier.verifyBundle(bundle);
53
27
 
28
+ // Per-step results and measurements
54
29
  const doc = verifier.getVerificationDocument();
55
- console.log(doc.securityVerified);
30
+ console.log(doc?.securityVerified);
56
31
  ```
57
32
 
58
- ## Error Handling
59
-
60
- For callers that want structured error handling, these error classes are part of the public API:
61
-
62
- - `ConfigurationError` — client misconfigured (e.g., missing required options)
63
- - `FetchError` — network or HTTP errors when fetching attestation material
64
- - `AttestationError` — attestation verification failed (parsing, signatures, certificates, measurement mismatch, policy violation)
65
-
66
- ## Inspecting Verification Results
67
-
68
- The verification document contains detailed information about each step:
33
+ `verifyBundle(bundle)` verifies an attestation bundle you already hold. Failed verification throws `AttestationError`, a failed fetch in `verify()` throws `FetchError`, and missing options throw `ConfigurationError`.
69
34
 
70
- ```typescript
71
- const doc = verifier.getVerificationDocument();
72
-
73
- // Overall result
74
- console.log(doc.securityVerified); // true if all checks passed
75
-
76
- // Individual steps
77
- console.log(doc.steps.fetchDigest); // Fetched release digest from GitHub
78
- console.log(doc.steps.verifyCode); // Verified code via Sigstore
79
- console.log(doc.steps.verifyEnclave); // Verified AMD SEV-SNP attestation
80
- console.log(doc.steps.compareMeasurements); // Compared code vs enclave measurements
81
-
82
- // Measurements
83
- console.log(doc.codeFingerprint); // Expected measurement from signed release
84
- console.log(doc.enclaveFingerprint); // Actual measurement from enclave
85
- console.log(doc.releaseTag); // GitHub release selected for verification
86
- console.log(doc.verifier); // Verifier package identity and version
87
- console.log(doc.verifiedAt); // Local completion time, not evidence freshness
88
- ```
35
+ Obtaining `tlsPublicKeyFingerprint` does not pin anything: a custom transport must compare it with the live peer certificate's SPKI on every new TLS connection, in addition to normal hostname and certificate validation.
89
36
 
90
- ### Using Your Own Transport
37
+ Release metadata and attestation bundles are fetched through Tinfoil-hosted GitHub proxy endpoints, so verification fails in environments that cannot reach them.
91
38
 
92
- `Verifier` does not require callers to use the main SDK transport. After
93
- verification, `tlsPublicKeyFingerprint` contains the attested SHA-256 SPKI
94
- fingerprint and can be passed to a separate HTTP implementation:
95
-
96
- ```typescript
97
- const attestation = await verifier.verify();
98
- const expectedSpkiFingerprint = attestation.tlsPublicKeyFingerprint;
99
- ```
100
-
101
- The custom transport must compare that value with the live peer certificate's
102
- SPKI on every new TLS connection and must still perform normal hostname and
103
- certificate validation. Merely obtaining the fingerprint does not pin the
104
- connection.
105
-
106
- ## What Gets Verified
107
-
108
- The `Verifier` performs a multi-step verification:
109
-
110
- 1. **Fetch Release Digest** — Gets the expected code digest from the signed GitHub release
111
- 2. **Verify Code Provenance** — Uses Sigstore (Fulcio + Rekor) to verify the release signature
112
- 3. **Verify Enclave Attestation** — Validates the AMD SEV-SNP attestation report and VCEK certificate chain
113
- 4. **Compare Measurements** — Ensures the enclave is running the exact code from the signed release
114
-
115
- ## Features
116
-
117
- - AMD SEV-SNP attestation verification (VCEK certificate chain validation)
118
- - Sigstore code provenance verification (Fulcio + Rekor)
119
- - TUF-based trusted root updates
120
- - Works in Node.js and browsers (uses Web Crypto API)
121
-
122
- ## GitHub Proxy Dependency
123
-
124
- This package fetches GitHub release metadata and attestation bundles via Tinfoil-hosted
125
- GitHub proxy endpoints (to avoid rate-limits/CORS issues). If your environment cannot
126
- reach these endpoints, verification that depends on GitHub release attestations will fail.
127
-
128
- ## Relationship to `tinfoil` Package
129
-
130
- The main [`tinfoil`](https://www.npmjs.com/package/tinfoil) package includes this verifier and uses it automatically:
131
-
132
- ```typescript
133
- // tinfoil package — verification happens automatically
134
- import { TinfoilAI } from 'tinfoil';
135
- const client = new TinfoilAI({ apiKey: 'key' });
136
- // Verification runs when you make your first request
137
-
138
- // You can also access the verification document
139
- const doc = await client.getVerificationDocument();
140
- ```
141
-
142
- Use `@tinfoilsh/verifier` directly only if you have specific needs listed in "When to Use This Package" above.
143
-
144
- ## Learn More
145
-
146
- - [How It Works](https://docs.tinfoil.sh/cc/how-it-works) — Confidential computing overview
147
- - [Verifiability](https://docs.tinfoil.sh/cc/verifiability) — How attestation proves security
148
- - [Attestation Architecture](https://docs.tinfoil.sh/verification/attestation-architecture) — Technical deep-dive
149
- - [Overview of Verification](https://docs.tinfoil.sh/verification/how-to-verify) — Verification process
39
+ See [Attestation architecture](https://docs.tinfoil.sh/verification/attestation-architecture) and [Verification in Tinfoil](https://docs.tinfoil.sh/verification/verification-in-tinfoil) for what gets verified.
150
40
 
151
41
  ## Development
152
42
 
@@ -155,3 +45,12 @@ npm run build
155
45
  npm test
156
46
  npm run test:browser
157
47
  ```
48
+
49
+ ## Reporting Vulnerabilities
50
+
51
+ Please report security vulnerabilities by either:
52
+
53
+ - Emailing [security@tinfoil.sh](mailto:security@tinfoil.sh)
54
+ - Opening an issue on GitHub on this repository
55
+
56
+ We aim to respond to (legitimate) security reports within 24 hours.
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export declare const VERIFIER_NAME = "@tinfoilsh/verifier";
2
- export declare const VERIFIER_VERSION = "1.2.2";
2
+ export declare const VERIFIER_VERSION = "1.2.3";
3
3
  export declare const VERIFICATION_DOCUMENT_SCHEMA_VERSION: 1;
4
4
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export const VERIFIER_NAME = '@tinfoilsh/verifier';
2
- export const VERIFIER_VERSION = '1.2.2';
2
+ export const VERIFIER_VERSION = '1.2.3';
3
3
  export const VERIFICATION_DOCUMENT_SCHEMA_VERSION = 1;
4
4
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinfoilsh/verifier",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "AMD SEV-SNP attestation verifier for Node.js and browsers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -55,6 +55,6 @@
55
55
  "@freedomofpress/tuf-browser": "^0.1.11"
56
56
  },
57
57
  "engines": {
58
- "node": ">=20"
58
+ "node": "^22.23.4 || ^24.22.1 || >=26.12.1"
59
59
  }
60
60
  }