@akai-workflow-builder/cli-sdk 0.19.0 → 0.20.1
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/CHANGELOG.md +22 -0
- package/dist/ctx/blocked-domains.d.ts +23 -0
- package/dist/ctx/blocked-domains.d.ts.map +1 -0
- package/dist/ctx/blocked-domains.js +59 -0
- package/dist/ctx/build-ctx.d.ts.map +1 -1
- package/dist/ctx/build-ctx.js +8 -2
- package/dist/ctx/egress-refusal.d.ts +47 -0
- package/dist/ctx/egress-refusal.d.ts.map +1 -0
- package/dist/ctx/egress-refusal.js +85 -0
- package/dist/ctx/pinned-get.d.ts +16 -0
- package/dist/ctx/pinned-get.d.ts.map +1 -0
- package/dist/ctx/pinned-get.js +58 -0
- package/dist/ctx/read-file-stream.d.ts +5 -2
- package/dist/ctx/read-file-stream.d.ts.map +1 -1
- package/dist/ctx/read-file-stream.js +4 -10
- package/dist/ctx/read-file.d.ts +8 -3
- package/dist/ctx/read-file.d.ts.map +1 -1
- package/dist/ctx/read-file.js +7 -11
- package/dist/ctx/safe-fetch.d.ts +15 -0
- package/dist/ctx/safe-fetch.d.ts.map +1 -1
- package/dist/ctx/safe-fetch.js +103 -39
- package/dist/ctx/sftp.d.ts +3 -0
- package/dist/ctx/sftp.d.ts.map +1 -1
- package/dist/ctx/sftp.js +2 -0
- package/dist/ctx/url-input.d.ts +38 -0
- package/dist/ctx/url-input.d.ts.map +1 -0
- package/dist/ctx/url-input.js +107 -0
- package/dist/ctx/vetted-dispatcher.d.ts +69 -0
- package/dist/ctx/vetted-dispatcher.d.ts.map +1 -0
- package/dist/ctx/vetted-dispatcher.js +168 -0
- package/dist/file-input.d.ts +3 -4
- package/dist/file-input.d.ts.map +1 -1
- package/dist/file-input.js +3 -4
- package/dist/types.d.ts +3 -3
- package/package.json +3 -2
package/dist/ctx/safe-fetch.js
CHANGED
|
@@ -4,8 +4,11 @@ import { isIPv4, isIPv6 } from 'node:net';
|
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
5
|
import { Readable } from 'node:stream';
|
|
6
6
|
import { AkaiEgressError, AkaiResponseTooLargeError } from '../errors.js';
|
|
7
|
+
import { blockedDomainOf } from './blocked-domains.js';
|
|
8
|
+
import { reportEgressRefusal } from './egress-refusal.js';
|
|
7
9
|
import { canonicalIp, cidrContains, isForbiddenPinAddress, normalizePrivateEgress, } from './private-egress.js';
|
|
8
10
|
import { ensureTrustedCa } from './trusted-ca.js';
|
|
11
|
+
import { nodeEnvProxyEnabled, rememberVetted, vettedDispatcher } from './vetted-dispatcher.js';
|
|
9
12
|
/**
|
|
10
13
|
* Default per-response byte cap for JSON/text `ctx.fetch` calls (override via
|
|
11
14
|
* {@link SafeFetchBinding.maxResponseBytes}). Grounded in prod trace data
|
|
@@ -42,23 +45,44 @@ function canonicalizeIPv6(ip) {
|
|
|
42
45
|
return ip;
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
/** The eight 16-bit groups of a canonical (RFC 5952, hex-only) IPv6 address, or null. */
|
|
49
|
+
function ipv6Groups(v) {
|
|
50
|
+
const halves = v.split('::');
|
|
51
|
+
if (halves.length > 2)
|
|
52
|
+
return null;
|
|
53
|
+
const head = halves[0] ? halves[0].split(':') : [];
|
|
54
|
+
const tail = halves.length === 2 && halves[1] ? halves[1].split(':') : [];
|
|
55
|
+
const fill = halves.length === 2 ? Array(8 - head.length - tail.length).fill('0') : [];
|
|
56
|
+
const groups = [...head, ...fill, ...tail].map((g) => (/^[0-9a-f]{1,4}$/.test(g) ? parseInt(g, 16) : NaN));
|
|
57
|
+
return groups.length === 8 && groups.every((g) => Number.isInteger(g)) ? groups : null;
|
|
58
|
+
}
|
|
59
|
+
const v4FromGroups = (hi, lo) => `${hi >> 8}.${hi & 0xff}.${lo >> 8}.${lo & 0xff}`;
|
|
60
|
+
const startsWithGroups = (g, prefix) => prefix.every((v, i) => g[i] === v);
|
|
61
|
+
// IPv6 forms that carry an IPv4 address in their last 32 bits: IPv4-compatible (::/96, which also covers
|
|
62
|
+
// :: and ::1), IPv4-mapped (::ffff:0:0/96), IPv4-translated (::ffff:0:0:0/96) and NAT64 (64:ff9b::/96).
|
|
63
|
+
const V4_IN_LAST_TWO_GROUPS = [
|
|
64
|
+
[0, 0, 0, 0, 0, 0],
|
|
65
|
+
[0, 0, 0, 0, 0, 0xffff],
|
|
66
|
+
[0, 0, 0, 0, 0xffff, 0],
|
|
67
|
+
[0x64, 0xff9b, 0, 0, 0, 0],
|
|
68
|
+
];
|
|
69
|
+
/** The IPv4 address an IPv6 address carries — in its last 32 bits, or after a 6to4 2002::/16 prefix — or null. */
|
|
70
|
+
function embeddedIPv4(g) {
|
|
71
|
+
if (V4_IN_LAST_TWO_GROUPS.some((prefix) => startsWithGroups(g, prefix)))
|
|
72
|
+
return v4FromGroups(g[6], g[7]);
|
|
73
|
+
if (g[0] === 0x2002)
|
|
74
|
+
return v4FromGroups(g[1], g[2]);
|
|
55
75
|
return null;
|
|
56
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Whether `ip` is an address no tool may reach: loopback, unspecified, RFC 1918, link-local (the
|
|
79
|
+
* metadata address), carrier-grade NAT, IETF protocol assignments, benchmarking, multicast and the
|
|
80
|
+
* reserved 240/4 with broadcast; for IPv6 also ULA, site-local, multicast, and any form that carries a
|
|
81
|
+
* private IPv4 address. Kept in step with the worker's src/cli/lib/safe-fetch.js (AKAI-4268).
|
|
82
|
+
*/
|
|
57
83
|
export function isPrivateIp(ip) {
|
|
58
84
|
if (isIPv4(ip)) {
|
|
59
|
-
const
|
|
60
|
-
const a = parts[0];
|
|
61
|
-
const b = parts[1];
|
|
85
|
+
const [a, b, c] = ip.split('.').map(Number);
|
|
62
86
|
if (a === 0 || a === 10 || a === 127)
|
|
63
87
|
return true;
|
|
64
88
|
if (a === 169 && b === 254)
|
|
@@ -67,21 +91,31 @@ export function isPrivateIp(ip) {
|
|
|
67
91
|
return true;
|
|
68
92
|
if (a === 192 && b === 168)
|
|
69
93
|
return true;
|
|
70
|
-
|
|
94
|
+
if (a === 100 && b >= 64 && b <= 127)
|
|
95
|
+
return true; // 100.64.0.0/10 carrier-grade NAT
|
|
96
|
+
if (a === 192 && b === 0 && c === 0)
|
|
97
|
+
return true; // 192.0.0.0/24 IETF protocol assignments
|
|
98
|
+
if (a === 198 && (b === 18 || b === 19))
|
|
99
|
+
return true; // 198.18.0.0/15 benchmarking
|
|
100
|
+
return a >= 224; // 224/4 multicast, 240/4 reserved, 255.255.255.255
|
|
71
101
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
return
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
return true;
|
|
84
|
-
|
|
102
|
+
// A zone id (`%eth0`) is not part of the address: WHATWG URL refuses it, so it is cut before canonicalizing.
|
|
103
|
+
const unscoped = ip.replace(/%.*$/, '');
|
|
104
|
+
if (isIPv6(unscoped)) {
|
|
105
|
+
const g = ipv6Groups(canonicalizeIPv6(unscoped).toLowerCase());
|
|
106
|
+
if (!g)
|
|
107
|
+
return true; // unparseable → fail closed
|
|
108
|
+
const embedded = embeddedIPv4(g);
|
|
109
|
+
if (embedded !== null)
|
|
110
|
+
return isPrivateIp(embedded);
|
|
111
|
+
const first = g[0];
|
|
112
|
+
if ((first & 0xfe00) === 0xfc00)
|
|
113
|
+
return true; // fc00::/7 unique local
|
|
114
|
+
if ((first & 0xffc0) === 0xfe80)
|
|
115
|
+
return true; // fe80::/10 link-local
|
|
116
|
+
if ((first & 0xffc0) === 0xfec0)
|
|
117
|
+
return true; // fec0::/10 site-local
|
|
118
|
+
return first >> 8 === 0xff; // ff00::/8 multicast
|
|
85
119
|
}
|
|
86
120
|
return false;
|
|
87
121
|
}
|
|
@@ -160,7 +194,7 @@ function abortError(signal) {
|
|
|
160
194
|
// `dns.lookup` has no native AbortSignal support. Race it so an abort during
|
|
161
195
|
// preflight surfaces promptly (and as the caller's signal.reason — matching
|
|
162
196
|
// fetch's contract) instead of being shadowed by a DNS result.
|
|
163
|
-
async function lookupWithSignal(hostname, signal) {
|
|
197
|
+
export async function lookupWithSignal(hostname, signal) {
|
|
164
198
|
if (!signal)
|
|
165
199
|
return dns.lookup(hostname, { all: true });
|
|
166
200
|
return new Promise((resolve, reject) => {
|
|
@@ -224,6 +258,14 @@ export function createSafeFetch(binding) {
|
|
|
224
258
|
egress,
|
|
225
259
|
});
|
|
226
260
|
}
|
|
261
|
+
// A host on the blocked-domain list is refused by name, whatever the egress
|
|
262
|
+
// allowlist says and in development too, before the lookup: resolving a DNS
|
|
263
|
+
// logger's name already sends it the data the name carries (blocked-domains.ts).
|
|
264
|
+
const blockedDomain = blockedDomainOf(u.hostname);
|
|
265
|
+
if (blockedDomain !== null) {
|
|
266
|
+
reportEgressRefusal(binding.onEgressRefused, { via: 'sdk_fetch', host: u.hostname, reason: 'blocked_domain' });
|
|
267
|
+
throw new AkaiEgressError(`safe-fetch: refusing ${u.hostname}: ${blockedDomain} is on Akai's blocked-domain list`, { hostname: u.hostname, blockedDomain });
|
|
268
|
+
}
|
|
227
269
|
let addresses;
|
|
228
270
|
try {
|
|
229
271
|
addresses = await lookupWithSignal(u.hostname, signal);
|
|
@@ -250,6 +292,7 @@ export function createSafeFetch(binding) {
|
|
|
250
292
|
pinned = matchPrivatePin(privatePins, cliId, u, addresses.map((entry) => entry.address));
|
|
251
293
|
if (pinned !== null)
|
|
252
294
|
break;
|
|
295
|
+
reportEgressRefusal(binding.onEgressRefused, { via: 'sdk_fetch', host: u.hostname, reason: 'private_address', address });
|
|
253
296
|
throw new AkaiEgressError(`safe-fetch: ${u.hostname} resolved to private address ${address}`, { hostname: u.hostname, address, allResolved: addresses.map((entry) => entry.address) });
|
|
254
297
|
}
|
|
255
298
|
}
|
|
@@ -292,23 +335,42 @@ export function createSafeFetch(binding) {
|
|
|
292
335
|
// through to plain fetch: there is no TLS handshake to present a cert on.
|
|
293
336
|
//
|
|
294
337
|
// A pinned private-egress call also rides `node:https`, for a different
|
|
295
|
-
// reason:
|
|
296
|
-
//
|
|
297
|
-
// cannot take a per-connection CA. See pinnedHttpsFetch.
|
|
338
|
+
// reason: it needs a per-connection CA and a forced `Host`, which global
|
|
339
|
+
// fetch cannot take. See pinnedHttpsFetch.
|
|
298
340
|
//
|
|
299
341
|
// Extra CAs go into Node's default CA list (extended, never replaced) so
|
|
300
342
|
// every transport below picks them up: global fetch, a host-installed
|
|
301
343
|
// global dispatcher (e.g. a proxy), and the node:https mTLS path.
|
|
302
344
|
if (trustedCa !== undefined && u.protocol === 'https:')
|
|
303
345
|
ensureTrustedCa(trustedCa, { cliId, toolName });
|
|
304
|
-
|
|
305
|
-
|
|
346
|
+
// Every other call connects only to the addresses checked above, never to a
|
|
347
|
+
// second DNS answer (DNS rebinding): global fetch through a dispatcher whose
|
|
348
|
+
// lookup answers with them, the mutual-TLS path through the same lookup it
|
|
349
|
+
// gives a pinned call. Development skips this, as it skips the check. A
|
|
350
|
+
// transport the host installed (a proxy) is left alone: it dials, not us.
|
|
351
|
+
// See vetted-dispatcher.ts.
|
|
352
|
+
const checked = isDev ? null : addresses.map((entry) => entry.address);
|
|
353
|
+
let response;
|
|
354
|
+
if (pinned !== null) {
|
|
355
|
+
response = await pinnedHttpsFetch(u, sanitized, {
|
|
306
356
|
...(clientCert !== undefined ? { identity: clientCert } : {}),
|
|
307
357
|
pin: { addresses: pinned.addresses, ...(pinned.pin.caPem !== undefined ? { caPem: pinned.pin.caPem } : {}) },
|
|
308
|
-
})
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
else if (clientCert !== undefined && u.protocol === 'https:') {
|
|
361
|
+
response = await pinnedHttpsFetch(u, sanitized, {
|
|
362
|
+
identity: clientCert,
|
|
363
|
+
...(checked !== null && checked.length > 0 && !nodeEnvProxyEnabled() ? { connectTo: checked } : {}),
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
const dispatcher = checked !== null && checked.length > 0 ? await vettedDispatcher() : null;
|
|
368
|
+
if (dispatcher !== null)
|
|
369
|
+
rememberVetted(u.hostname, checked);
|
|
370
|
+
// `dispatcher` is an undici fetch option lib.dom's RequestInit does not name, and the undici
|
|
371
|
+
// package's Dispatcher type is a separate declaration from the one @types/node bundles.
|
|
372
|
+
response = await fetch(url, dispatcher !== null ? { ...sanitized, dispatcher } : sanitized);
|
|
373
|
+
}
|
|
312
374
|
return capResponseBody(response, maxBytes, { hostname: u.hostname, cliId, toolName });
|
|
313
375
|
};
|
|
314
376
|
}
|
|
@@ -396,7 +458,7 @@ export function pinnedLookup(addresses) {
|
|
|
396
458
|
* - `agent: false` opens a fresh connection through that `lookup` instead of
|
|
397
459
|
* reusing a pooled socket that was dialled under another answer.
|
|
398
460
|
*/
|
|
399
|
-
async function pinnedHttpsFetch(url, init, { identity, pin }) {
|
|
461
|
+
async function pinnedHttpsFetch(url, init, { identity, pin, connectTo }) {
|
|
400
462
|
const headers = init.headers;
|
|
401
463
|
const method = (init.method ?? 'GET').toUpperCase();
|
|
402
464
|
let body;
|
|
@@ -430,7 +492,9 @@ async function pinnedHttpsFetch(url, init, { identity, pin }) {
|
|
|
430
492
|
agent: false,
|
|
431
493
|
...(pin.caPem !== undefined ? { ca: pin.caPem } : {}),
|
|
432
494
|
}
|
|
433
|
-
:
|
|
495
|
+
: connectTo !== undefined
|
|
496
|
+
? { lookup: pinnedLookup(connectTo) }
|
|
497
|
+
: {}),
|
|
434
498
|
...(init.signal ? { signal: init.signal } : {}),
|
|
435
499
|
};
|
|
436
500
|
return new Promise((resolve, reject) => {
|
package/dist/ctx/sftp.d.ts
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
* load it.
|
|
28
28
|
*/
|
|
29
29
|
import { Readable } from 'node:stream';
|
|
30
|
+
import { type EgressRefusal } from './egress-refusal.js';
|
|
30
31
|
import { type SftpEgressEntry } from './sftp-egress.js';
|
|
31
32
|
/** Credentials and target for {@link SftpApi.connect}. */
|
|
32
33
|
export interface SftpConnectOptions {
|
|
@@ -89,6 +90,8 @@ export interface SftpBinding {
|
|
|
89
90
|
readonly loadSsh2?: () => Promise<typeof import('ssh2')>;
|
|
90
91
|
/** Test seam: resolve a hostname to all its addresses. */
|
|
91
92
|
readonly resolve?: (hostname: string) => Promise<string[]>;
|
|
93
|
+
/** One call per host refused for a private address (egress-refusal.ts); buildCtx logs it. */
|
|
94
|
+
readonly onEgressRefused?: (refusal: EgressRefusal) => void;
|
|
92
95
|
}
|
|
93
96
|
/** For tools whose transport is not sftp: every call explains what to declare instead. */
|
|
94
97
|
export declare function unavailableSftp(): SftpApi;
|
package/dist/ctx/sftp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sftp.d.ts","sourceRoot":"","sources":["../../src/ctx/sftp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,EAAE,QAAQ,EAAa,MAAM,aAAa,CAAC;AAYlD,OAAO,EAAyB,KAAK,eAAe,EAAwB,MAAM,kBAAkB,CAAC;AAErG,0DAA0D;AAC1D,MAAM,WAAW,kBAAkB;IACjC,mFAAmF;IACnF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,gGAAgG;IAChG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,U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,CAAC,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,cAAc,MAAM,CAAC,CAAC,CAAC;IACzD,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC3D,6FAA6F;IAC7F,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;CAC7D;AA4BD,0FAA0F;AAC1F,wBAAgB,eAAe,IAAI,OAAO,CASzC;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CA8FxD;AAqDD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO1D"}
|
package/dist/ctx/sftp.js
CHANGED
|
@@ -34,6 +34,7 @@ import { Readable, Transform } from 'node:stream';
|
|
|
34
34
|
import { pipeline } from 'node:stream/promises';
|
|
35
35
|
import { AkaiEgressError, AkaiInputError, AkaiResponseTooLargeError, AkaiSecretError, AkaiToolError, } from '../errors.js';
|
|
36
36
|
import { isPrivateIp } from './safe-fetch.js';
|
|
37
|
+
import { reportEgressRefusal } from './egress-refusal.js';
|
|
37
38
|
import { formatSftpEgressEntry } from './sftp-egress.js';
|
|
38
39
|
const READY_TIMEOUT_MS = 20_000;
|
|
39
40
|
/**
|
|
@@ -243,6 +244,7 @@ async function resolvePublicAddress(host, binding) {
|
|
|
243
244
|
if (process.env.NODE_ENV !== 'development') {
|
|
244
245
|
for (const address of addresses) {
|
|
245
246
|
if (isPrivateIp(address)) {
|
|
247
|
+
reportEgressRefusal(binding.onEgressRefused, { via: 'sdk_sftp', host, reason: 'private_address', address });
|
|
246
248
|
throw new AkaiEgressError(`sftp: ${host} resolved to private address ${address}`, { hostname: host, address, allResolved: addresses });
|
|
247
249
|
}
|
|
248
250
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type EgressRefusal } from './egress-refusal.js';
|
|
2
|
+
/** How many redirects one URL input may follow. Each hop is checked like the first. */
|
|
3
|
+
export declare const MAX_URL_INPUT_REDIRECTS = 5;
|
|
4
|
+
export interface UrlInputOptions {
|
|
5
|
+
/** Prefix for every error, e.g. `ctx.readFile`. */
|
|
6
|
+
readonly label: string;
|
|
7
|
+
/** Aborts the lookup and the request when the tool's invocation is cancelled. */
|
|
8
|
+
readonly signal: AbortSignal;
|
|
9
|
+
/** One call per refused host (egress-refusal.ts); buildCtx logs it as `egress.refused`. */
|
|
10
|
+
readonly onEgressRefused?: (refusal: EgressRefusal) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Fetch an `http(s)://` file input for `ctx.readFile` / `ctx.readFileStream`
|
|
14
|
+
* and return the final response, whatever its status — the caller reads it.
|
|
15
|
+
*
|
|
16
|
+
* The URL is whatever the agent passed for the file argument: the worker hands
|
|
17
|
+
* an `http(s)://` value to the tool unchanged. There is no per-tool egress
|
|
18
|
+
* allowlist here — a file can live anywhere public — but the URL may not reach
|
|
19
|
+
* inside Akai's network, the same rule ctx.fetch and ctx.sftp apply:
|
|
20
|
+
*
|
|
21
|
+
* - a host on the blocked-domain list is refused by name, before any lookup;
|
|
22
|
+
* - the host is resolved and EVERY address checked: one private address
|
|
23
|
+
* (loopback, RFC 1918, link-local incl. the cloud metadata address, cluster
|
|
24
|
+
* service ranges, IPv6 ULA, …) refuses the call;
|
|
25
|
+
* - the connection goes only to the addresses that were checked (`pinnedGet`),
|
|
26
|
+
* so a second DNS answer cannot redirect it;
|
|
27
|
+
* - a redirect is followed by hand, at most {@link MAX_URL_INPUT_REDIRECTS}
|
|
28
|
+
* times, and every hop is checked the same way before it is dialled.
|
|
29
|
+
*
|
|
30
|
+
* Each refusal is reported through `onEgressRefused` as `sdk_read_file`, with
|
|
31
|
+
* the host and never the URL (a presigned URL carries its signature).
|
|
32
|
+
*
|
|
33
|
+
* With `NODE_ENV=development` only the blocked-domain check applies and the
|
|
34
|
+
* request goes through global fetch, so the local stack's object store on
|
|
35
|
+
* localhost keeps working.
|
|
36
|
+
*/
|
|
37
|
+
export declare function fetchUrlInput(value: string, opts: UrlInputOptions): Promise<Response>;
|
|
38
|
+
//# sourceMappingURL=url-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-input.d.ts","sourceRoot":"","sources":["../../src/ctx/url-input.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAI9E,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAIzC,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,2FAA2F;IAC3F,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;CAC7D;AAMD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,CAsE3F"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { blockedDomainOf } from './blocked-domains.js';
|
|
2
|
+
import { reportEgressRefusal } from './egress-refusal.js';
|
|
3
|
+
import { pinnedGet } from './pinned-get.js';
|
|
4
|
+
import { isPrivateIp, lookupWithSignal } from './safe-fetch.js';
|
|
5
|
+
/** How many redirects one URL input may follow. Each hop is checked like the first. */
|
|
6
|
+
export const MAX_URL_INPUT_REDIRECTS = 5;
|
|
7
|
+
const REDIRECT_STATUSES = new Set([301, 302, 303, 307, 308]);
|
|
8
|
+
function causeOf(err) {
|
|
9
|
+
return err instanceof Error ? err.message : String(err);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Fetch an `http(s)://` file input for `ctx.readFile` / `ctx.readFileStream`
|
|
13
|
+
* and return the final response, whatever its status — the caller reads it.
|
|
14
|
+
*
|
|
15
|
+
* The URL is whatever the agent passed for the file argument: the worker hands
|
|
16
|
+
* an `http(s)://` value to the tool unchanged. There is no per-tool egress
|
|
17
|
+
* allowlist here — a file can live anywhere public — but the URL may not reach
|
|
18
|
+
* inside Akai's network, the same rule ctx.fetch and ctx.sftp apply:
|
|
19
|
+
*
|
|
20
|
+
* - a host on the blocked-domain list is refused by name, before any lookup;
|
|
21
|
+
* - the host is resolved and EVERY address checked: one private address
|
|
22
|
+
* (loopback, RFC 1918, link-local incl. the cloud metadata address, cluster
|
|
23
|
+
* service ranges, IPv6 ULA, …) refuses the call;
|
|
24
|
+
* - the connection goes only to the addresses that were checked (`pinnedGet`),
|
|
25
|
+
* so a second DNS answer cannot redirect it;
|
|
26
|
+
* - a redirect is followed by hand, at most {@link MAX_URL_INPUT_REDIRECTS}
|
|
27
|
+
* times, and every hop is checked the same way before it is dialled.
|
|
28
|
+
*
|
|
29
|
+
* Each refusal is reported through `onEgressRefused` as `sdk_read_file`, with
|
|
30
|
+
* the host and never the URL (a presigned URL carries its signature).
|
|
31
|
+
*
|
|
32
|
+
* With `NODE_ENV=development` only the blocked-domain check applies and the
|
|
33
|
+
* request goes through global fetch, so the local stack's object store on
|
|
34
|
+
* localhost keeps working.
|
|
35
|
+
*/
|
|
36
|
+
export async function fetchUrlInput(value, opts) {
|
|
37
|
+
const { label, signal } = opts;
|
|
38
|
+
const fail = (why) => new Error(`${label}: ${value}: ${why}`);
|
|
39
|
+
let url;
|
|
40
|
+
try {
|
|
41
|
+
url = new URL(value);
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
throw fail('not a valid URL');
|
|
45
|
+
}
|
|
46
|
+
const refuseBlockedDomain = (hop) => {
|
|
47
|
+
const blocked = blockedDomainOf(hop.hostname);
|
|
48
|
+
if (blocked === null)
|
|
49
|
+
return;
|
|
50
|
+
reportEgressRefusal(opts.onEgressRefused, { via: 'sdk_read_file', host: hop.hostname, reason: 'blocked_domain' });
|
|
51
|
+
throw fail(`${blocked} is on Akai's blocked-domain list`);
|
|
52
|
+
};
|
|
53
|
+
if (process.env.NODE_ENV === 'development') {
|
|
54
|
+
refuseBlockedDomain(url);
|
|
55
|
+
try {
|
|
56
|
+
return await fetch(value, { signal });
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
throw fail(causeOf(err));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
for (let redirects = 0;; redirects++) {
|
|
63
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') {
|
|
64
|
+
throw fail(`refusing a redirect to a ${url.protocol} URL`);
|
|
65
|
+
}
|
|
66
|
+
refuseBlockedDomain(url);
|
|
67
|
+
// WHATWG URL keeps an IPv6 literal's brackets; the resolver wants the bare address.
|
|
68
|
+
const hostname = url.hostname.replace(/^\[|\]$/g, '');
|
|
69
|
+
let addresses;
|
|
70
|
+
try {
|
|
71
|
+
addresses = await lookupWithSignal(hostname, signal);
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
throw fail(signal.aborted ? causeOf(err) : `DNS lookup failed for ${url.hostname}: ${causeOf(err)}`);
|
|
75
|
+
}
|
|
76
|
+
for (const { address } of addresses) {
|
|
77
|
+
if (isPrivateIp(address)) {
|
|
78
|
+
reportEgressRefusal(opts.onEgressRefused, {
|
|
79
|
+
via: 'sdk_read_file',
|
|
80
|
+
host: url.hostname,
|
|
81
|
+
reason: 'private_address',
|
|
82
|
+
address,
|
|
83
|
+
});
|
|
84
|
+
throw fail(`${url.hostname} resolves to the private address ${address}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
let response;
|
|
88
|
+
try {
|
|
89
|
+
response = await pinnedGet(url, addresses.map((entry) => entry.address), signal);
|
|
90
|
+
}
|
|
91
|
+
catch (err) {
|
|
92
|
+
throw fail(causeOf(err));
|
|
93
|
+
}
|
|
94
|
+
const location = response.headers.get('location');
|
|
95
|
+
if (!REDIRECT_STATUSES.has(response.status) || location === null)
|
|
96
|
+
return response;
|
|
97
|
+
await response.body?.cancel().catch(() => { });
|
|
98
|
+
if (redirects >= MAX_URL_INPUT_REDIRECTS)
|
|
99
|
+
throw fail(`more than ${MAX_URL_INPUT_REDIRECTS} redirects`);
|
|
100
|
+
try {
|
|
101
|
+
url = new URL(location, url);
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
throw fail(`HTTP ${response.status} redirects to an invalid URL`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hold a `ctx.fetch` connection to the addresses safe-fetch checked.
|
|
3
|
+
*
|
|
4
|
+
* safe-fetch resolves a host and refuses it when any answer is private. Global
|
|
5
|
+
* fetch then resolves the name again on its own, so a name that answers public
|
|
6
|
+
* for the check and private a moment later (DNS rebinding) would be dialled at
|
|
7
|
+
* the private address. The dispatcher here is an undici Agent whose
|
|
8
|
+
* `connect.lookup` never asks DNS: it answers with the addresses safe-fetch
|
|
9
|
+
* vetted for that hostname, the same idea as the worker's `publicLookup`.
|
|
10
|
+
*
|
|
11
|
+
* What stays as it was:
|
|
12
|
+
* - The URL still names the request. The `Host` header and the TLS servername
|
|
13
|
+
* (and so certificate verification) are the hostname; only the address a
|
|
14
|
+
* socket dials comes from the vetted list.
|
|
15
|
+
* - Pooling. One Agent serves every call, so keep-alive works as it did on the
|
|
16
|
+
* global dispatcher. A pooled socket was dialled at an address vetted for its
|
|
17
|
+
* host, so reusing it reaches nothing new.
|
|
18
|
+
* - A host-installed transport. When the global dispatcher is not a plain
|
|
19
|
+
* direct Agent (the worker's PROXY_LOCATION ProxyAgent, Node's env proxy, a
|
|
20
|
+
* test's MockAgent, anything else) it is left alone: {@link vettedDispatcher}
|
|
21
|
+
* returns null and the call rides global fetch as before. A proxy resolves
|
|
22
|
+
* the name itself; the SDK has no say over which address it dials.
|
|
23
|
+
*
|
|
24
|
+
* undici 8 is loaded by file, not through its index: the index claims Node's
|
|
25
|
+
* global dispatcher when it loads, and this module must not change the
|
|
26
|
+
* transport of any other fetch in the host process. The imports are literal
|
|
27
|
+
* dynamic imports so a bundler inlines them: cli-service's baseline bundle
|
|
28
|
+
* carries this runtime to a directory with no node_modules.
|
|
29
|
+
*/
|
|
30
|
+
import { type LookupFunction } from 'node:net';
|
|
31
|
+
import type { Dispatcher1Wrapper as UndiciDispatcher1Wrapper } from 'undici';
|
|
32
|
+
/** Error code for a connection to a hostname with no vetted addresses on record. */
|
|
33
|
+
export declare const UNVETTED_CODE = "ESAFEFETCHUNVETTED";
|
|
34
|
+
/**
|
|
35
|
+
* Record the addresses safe-fetch checked for `hostname`. The next connection
|
|
36
|
+
* the dispatcher opens to that host dials one of these and nothing else. A
|
|
37
|
+
* later call replaces the entry; every entry ever stored passed the check.
|
|
38
|
+
*/
|
|
39
|
+
export declare function rememberVetted(hostname: string, addresses: readonly string[]): void;
|
|
40
|
+
/**
|
|
41
|
+
* The `connect.lookup` of the dispatcher: answers with the vetted addresses
|
|
42
|
+
* for the hostname, in either shape Node asks for (`all: true` for
|
|
43
|
+
* happy-eyeballs, the default since Node 20, or a single address and family),
|
|
44
|
+
* honouring a requested family. A hostname with nothing on record fails the
|
|
45
|
+
* connection rather than falling back to DNS.
|
|
46
|
+
*/
|
|
47
|
+
export declare const vettedLookup: LookupFunction;
|
|
48
|
+
/**
|
|
49
|
+
* The dispatcher a vetted `ctx.fetch` call passes to global fetch, or null when
|
|
50
|
+
* the host has installed a transport of its own (see the module comment) or
|
|
51
|
+
* undici could not be loaded — the call then goes out exactly as it did before
|
|
52
|
+
* this module existed, rather than failing.
|
|
53
|
+
*
|
|
54
|
+
* It mirrors the transport it stands in for: under Node's default it speaks
|
|
55
|
+
* HTTP/1.1 only, as Node's Agent does; under an undici 8 global Agent it keeps
|
|
56
|
+
* undici 8's defaults, HTTP/2 negotiation included. Node 24's fetch speaks the
|
|
57
|
+
* v1 handler API, so the undici 8 Agent sits behind Dispatcher1Wrapper, as in
|
|
58
|
+
* the worker.
|
|
59
|
+
*/
|
|
60
|
+
export declare function vettedDispatcher(): Promise<UndiciDispatcher1Wrapper | null>;
|
|
61
|
+
/**
|
|
62
|
+
* Whether Node routes `node:https` through an env-configured proxy
|
|
63
|
+
* (`NODE_USE_ENV_PROXY` / `--use-env-proxy`). The mutual-TLS path leaves its
|
|
64
|
+
* lookup alone then: the socket goes to the proxy, not to the vetted address.
|
|
65
|
+
*/
|
|
66
|
+
export declare function nodeEnvProxyEnabled(): boolean;
|
|
67
|
+
/** Test seam: forget every vetted address and dispatcher. */
|
|
68
|
+
export declare function resetVettedDispatchForTests(): void;
|
|
69
|
+
//# sourceMappingURL=vetted-dispatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vetted-dispatcher.d.ts","sourceRoot":"","sources":["../../src/ctx/vetted-dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAU,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAwB,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAEnG,oFAAoF;AACpF,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAUlD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAWnF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,cAmB1B,CAAC;AAgDF;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAmBjF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAI7C;AAED,6DAA6D;AAC7D,wBAAgB,2BAA2B,IAAI,IAAI,CAIlD"}
|