@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/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,28 @@ All notable changes to `@akai-workflow-builder/cli-sdk` are documented here.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
6
|
|
|
7
|
+
## [0.20.1](https://github.com/akai-workflow-builder/akai-cli-sdk/compare/cli-sdk-v0.20.0...cli-sdk-v0.20.1) (2026-12-02)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **ctx:** connect ctx.fetch only to the addresses its egress check vetted (AKAI-4323) ([2331639](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/23316395679c35421d2f64fd5df84569a5239e4a))
|
|
13
|
+
|
|
14
|
+
## [0.20.0](https://github.com/akai-workflow-builder/akai-cli-sdk/compare/cli-sdk-v0.19.0...cli-sdk-v0.20.0) (2026-11-26)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **ctx:** log every refused egress as egress.refused (AKAI-4277) ([066a4b1](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/066a4b16d427422b5e1631bfa749507649bb48b9))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **ctx:** refuse private addresses in ctx.readFile URL inputs (AKAI-4277) ([9de3501](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/9de350186443627cdd7fb1d560abd5daa68ad892))
|
|
25
|
+
* **ctx:** refuse webhook.site, interact.sh, oast.* and pipedream.net by name (AKAI-4277) ([95cd398](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/95cd398cb1ebf5b11731d34704d3d7c61a1e88ba))
|
|
26
|
+
* **safe-fetch:** refuse DNS-rebinding and callback domains by name (AKAI-4277) ([fde25a1](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/fde25a1efd455a3c7d246ab8b6cf2b1aabb44f94))
|
|
27
|
+
* **safe-fetch:** refuse every private and reserved address range (AKAI-4268) ([806b07e](https://github.com/akai-workflow-builder/akai-cli-sdk/commit/806b07eb62cb87a18d6b78f5b3f6e9720dfd3fa7))
|
|
28
|
+
|
|
7
29
|
## [0.19.0](https://github.com/akai-workflow-builder/akai-cli-sdk/compare/cli-sdk-v0.18.0...cli-sdk-v0.19.0) (2026-11-25)
|
|
8
30
|
|
|
9
31
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domains a tool's `ctx.fetch` never connects to, nor even resolves (AKAI-4277), whatever its egress
|
|
3
|
+
* allowlist says. Attackers use them in two ways:
|
|
4
|
+
*
|
|
5
|
+
* - wildcard and rebinding DNS: a name such as `10.0.0.1.nip.io` answers with the address it spells,
|
|
6
|
+
* or alternates between a public and an internal one, to walk a request into a private network;
|
|
7
|
+
* - out-of-band callbacks: a request or a DNS lookup to such a service tells the attacker that a
|
|
8
|
+
* blind SSRF worked, and the name itself can carry stolen data (`<data>.dnslog.cn`).
|
|
9
|
+
*
|
|
10
|
+
* So the check is by name and comes before any lookup: resolving `<data>.dnslog.cn` already leaks
|
|
11
|
+
* `<data>`. It holds in development too. akai-app (lib/utils/blocked-domains.ts) and the worker
|
|
12
|
+
* (src/cli/lib/blocked-domains.js) keep the same list; test/ctx/fixtures/blocked-domains-contract.json,
|
|
13
|
+
* which each repo holds byte for byte, pins all three.
|
|
14
|
+
*/
|
|
15
|
+
export declare const BLOCKED_DOMAINS: readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* The listed domain `hostname` is, or is under (`a.b.nip.io` is under `nip.io`), else null. Case,
|
|
18
|
+
* IPv6 brackets and a trailing root dot (`nip.io.`) do not change the answer.
|
|
19
|
+
*/
|
|
20
|
+
export declare function blockedDomainOf(hostname: string): string | null;
|
|
21
|
+
/** blockedDomainOf for a URL's host; null for a URL that does not parse (its fetch fails on its own). */
|
|
22
|
+
export declare function blockedDomainOfUrl(url: string): string | null;
|
|
23
|
+
//# sourceMappingURL=blocked-domains.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocked-domains.d.ts","sourceRoot":"","sources":["../../src/ctx/blocked-domains.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EA2B5C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG/D;AAED,yGAAyG;AACzG,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM7D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domains a tool's `ctx.fetch` never connects to, nor even resolves (AKAI-4277), whatever its egress
|
|
3
|
+
* allowlist says. Attackers use them in two ways:
|
|
4
|
+
*
|
|
5
|
+
* - wildcard and rebinding DNS: a name such as `10.0.0.1.nip.io` answers with the address it spells,
|
|
6
|
+
* or alternates between a public and an internal one, to walk a request into a private network;
|
|
7
|
+
* - out-of-band callbacks: a request or a DNS lookup to such a service tells the attacker that a
|
|
8
|
+
* blind SSRF worked, and the name itself can carry stolen data (`<data>.dnslog.cn`).
|
|
9
|
+
*
|
|
10
|
+
* So the check is by name and comes before any lookup: resolving `<data>.dnslog.cn` already leaks
|
|
11
|
+
* `<data>`. It holds in development too. akai-app (lib/utils/blocked-domains.ts) and the worker
|
|
12
|
+
* (src/cli/lib/blocked-domains.js) keep the same list; test/ctx/fixtures/blocked-domains-contract.json,
|
|
13
|
+
* which each repo holds byte for byte, pins all three.
|
|
14
|
+
*/
|
|
15
|
+
export const BLOCKED_DOMAINS = [
|
|
16
|
+
'nip.io',
|
|
17
|
+
'sslip.io',
|
|
18
|
+
'xip.io',
|
|
19
|
+
'rbndr.us',
|
|
20
|
+
'1u.ms',
|
|
21
|
+
'traefik.me',
|
|
22
|
+
'rebind.network',
|
|
23
|
+
'dnslog.cn',
|
|
24
|
+
'burpcollaborator.net',
|
|
25
|
+
'ntfy.sh',
|
|
26
|
+
'httpbin.org',
|
|
27
|
+
'requestcatcher.com',
|
|
28
|
+
'webhook.site',
|
|
29
|
+
'interact.sh',
|
|
30
|
+
'oast.fun',
|
|
31
|
+
'oast.me',
|
|
32
|
+
'oast.pro',
|
|
33
|
+
'oast.live',
|
|
34
|
+
'oast.site',
|
|
35
|
+
'oast.online',
|
|
36
|
+
'pipedream.net',
|
|
37
|
+
'localtest.me',
|
|
38
|
+
'lvh.me',
|
|
39
|
+
'vcap.me',
|
|
40
|
+
'localhost.direct',
|
|
41
|
+
'lacolhost.com',
|
|
42
|
+
];
|
|
43
|
+
/**
|
|
44
|
+
* The listed domain `hostname` is, or is under (`a.b.nip.io` is under `nip.io`), else null. Case,
|
|
45
|
+
* IPv6 brackets and a trailing root dot (`nip.io.`) do not change the answer.
|
|
46
|
+
*/
|
|
47
|
+
export function blockedDomainOf(hostname) {
|
|
48
|
+
const host = hostname.trim().toLowerCase().replace(/^\[|\]$/g, '').replace(/\.+$/, '');
|
|
49
|
+
return BLOCKED_DOMAINS.find((domain) => host === domain || host.endsWith(`.${domain}`)) ?? null;
|
|
50
|
+
}
|
|
51
|
+
/** blockedDomainOf for a URL's host; null for a URL that does not parse (its fetch fails on its own). */
|
|
52
|
+
export function blockedDomainOfUrl(url) {
|
|
53
|
+
try {
|
|
54
|
+
return blockedDomainOf(new URL(url).hostname);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-ctx.d.ts","sourceRoot":"","sources":["../../src/ctx/build-ctx.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,cAAc,CAAC;AAItB,OAAO,KAAK,EAAc,MAAM,EAAiB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{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GxD"}
|
package/dist/ctx/build-ctx.js
CHANGED
|
@@ -10,6 +10,7 @@ import { resolveBinding, resolveDynamicEgressHosts } from './dynamic-egress.js';
|
|
|
10
10
|
import { parseSftpEgress } from './sftp-egress.js';
|
|
11
11
|
import { createSftp, unavailableSftp } from './sftp.js';
|
|
12
12
|
import { normalizePem } from './pem.js';
|
|
13
|
+
import { egressRefusalLogger } from './egress-refusal.js';
|
|
13
14
|
function resolveTool(cli, toolName) {
|
|
14
15
|
const t = cli.tools[toolName];
|
|
15
16
|
if (!t) {
|
|
@@ -119,6 +120,9 @@ export function buildCtx(params) {
|
|
|
119
120
|
const secrets = buildScopedSecrets(params.cli.secrets, tool.options.secretKeys, params.secretValues, { oauthPresent: typeof params.oauthAccessToken === 'string' && params.oauthAccessToken !== '' });
|
|
120
121
|
const properties = buildScopedProperties(params.cli.properties, tool.options.propertyKeys, params.propertyValues ?? {});
|
|
121
122
|
const clientCert = resolveClientCert(tool, secrets, params.cli.id, params.toolName);
|
|
123
|
+
// Every guard below reports a request it refused for where it would go (a blocked domain, a private
|
|
124
|
+
// address) through this one `logger.warn`, which Akai's security alerts count (egress-refusal.ts).
|
|
125
|
+
const onEgressRefused = egressRefusalLogger(params.logger);
|
|
122
126
|
const isSftp = tool.transport === 'sftp' && tool.options.network !== undefined;
|
|
123
127
|
const sftp = isSftp
|
|
124
128
|
? createSftp({
|
|
@@ -127,6 +131,7 @@ export function buildCtx(params) {
|
|
|
127
131
|
toolName: params.toolName,
|
|
128
132
|
signal: params.signal,
|
|
129
133
|
maxReadBytes: tool.options.producesFiles === true ? PRODUCES_FILES_MAX_RESPONSE_BYTES : DEFAULT_MAX_RESPONSE_BYTES,
|
|
134
|
+
onEgressRefused,
|
|
130
135
|
})
|
|
131
136
|
: unavailableSftp();
|
|
132
137
|
const fetch = tool.transport === 'native' || tool.transport === 'sftp' || tool.options.network === undefined
|
|
@@ -155,14 +160,15 @@ export function buildCtx(params) {
|
|
|
155
160
|
...(tool.options.network.trustedCa !== undefined
|
|
156
161
|
? { trustedCa: tool.options.network.trustedCa }
|
|
157
162
|
: {}),
|
|
163
|
+
onEgressRefused,
|
|
158
164
|
});
|
|
159
165
|
const safePath = createSafePath([
|
|
160
166
|
params.workdir,
|
|
161
167
|
tmpdir(),
|
|
162
168
|
...(params.extraSafePathRoots ?? []),
|
|
163
169
|
]);
|
|
164
|
-
const readFile = createReadFile({ safePath, signal: params.signal });
|
|
165
|
-
const readFileStream = createReadFileStream({ safePath, signal: params.signal });
|
|
170
|
+
const readFile = createReadFile({ safePath, signal: params.signal, onEgressRefused });
|
|
171
|
+
const readFileStream = createReadFileStream({ safePath, signal: params.signal, onEgressRefused });
|
|
166
172
|
// Real writer only when the tool opted in (producesFiles) AND the host gave
|
|
167
173
|
// an outputDir — enforces the opt-in at the SDK boundary; else a throwing stub.
|
|
168
174
|
const writeFile = tool.options.producesFiles === true && params.outputDir !== undefined
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ToolLogger } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* One log entry for each request a ctx guard refused because of where it would go (AKAI-4268,
|
|
4
|
+
* AKAI-4277): a host on the blocked-domain list, or one that resolves to a private address. Akai's
|
|
5
|
+
* security alerts count these entries by their `event`. The worker and akai-app write the same entry
|
|
6
|
+
* from their own guards; a JSON fixture each repo holds byte for byte pins its shape
|
|
7
|
+
* (test/ctx/fixtures/egress-refusal-log-contract.json here).
|
|
8
|
+
*
|
|
9
|
+
* The SDK writes nothing itself: the guard reports through `onEgressRefused`, and buildCtx turns that
|
|
10
|
+
* into one `logger.warn(fields, msg)` on the logger its host gave it, which decides where the line goes.
|
|
11
|
+
*/
|
|
12
|
+
export type EgressRefusalReason = 'blocked_domain' | 'private_address';
|
|
13
|
+
export interface EgressRefusal {
|
|
14
|
+
/** The guard that refused: `sdk_fetch` (ctx.fetch), `sdk_read_file` (ctx.readFile, ctx.readFileStream) or `sdk_sftp`. */
|
|
15
|
+
readonly via: string;
|
|
16
|
+
/**
|
|
17
|
+
* The host the guard refused, as the request named it: never the URL, but every label of the name.
|
|
18
|
+
* Log it only through {@link egressRefusalEntry}, which drops the labels under a blocked domain.
|
|
19
|
+
*/
|
|
20
|
+
readonly host: string;
|
|
21
|
+
readonly reason: EgressRefusalReason;
|
|
22
|
+
/** The private address the host resolved to, when the guard read one. */
|
|
23
|
+
readonly address?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The entry as it is logged: the message, then the fields. */
|
|
26
|
+
export interface EgressRefusalEntry {
|
|
27
|
+
readonly msg: string;
|
|
28
|
+
readonly event: typeof EGRESS_REFUSED_EVENT;
|
|
29
|
+
readonly via: string;
|
|
30
|
+
readonly host: string;
|
|
31
|
+
readonly reason: EgressRefusalReason;
|
|
32
|
+
readonly address?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const EGRESS_REFUSED_EVENT = "egress.refused";
|
|
35
|
+
/** The entry for one refusal. */
|
|
36
|
+
export declare function egressRefusalEntry(refusal: EgressRefusal): EgressRefusalEntry;
|
|
37
|
+
/**
|
|
38
|
+
* The `onEgressRefused` buildCtx hands its guards: one `logger.warn(fields, msg)` per refusal. Within
|
|
39
|
+
* one ctx, the same refusal (one listed domain, or one private address, per guard) is logged once a
|
|
40
|
+
* minute at most, so a tool that retries in a loop cannot flood the log. The memory belongs to this
|
|
41
|
+
* reporter, not to the process: in a host that serves many tenants, one tenant's refusal never hides
|
|
42
|
+
* another's. Never throws.
|
|
43
|
+
*/
|
|
44
|
+
export declare function egressRefusalLogger(logger: ToolLogger, now?: () => number): (refusal: EgressRefusal) => void;
|
|
45
|
+
/** Call a guard's `onEgressRefused`, when it has one, without letting it throw into the refusal. */
|
|
46
|
+
export declare function reportEgressRefusal(onEgressRefused: ((refusal: EgressRefusal) => void) | undefined, refusal: EgressRefusal): void;
|
|
47
|
+
//# sourceMappingURL=egress-refusal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"egress-refusal.d.ts","sourceRoot":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import { blockedDomainOf } from './blocked-domains.js';
|
|
2
|
+
export const EGRESS_REFUSED_EVENT = 'egress.refused';
|
|
3
|
+
const MAX_HOST_CHARS = 253; // the longest DNS name
|
|
4
|
+
const ONCE_PER_MS = 60_000;
|
|
5
|
+
const MAX_REMEMBERED = 200;
|
|
6
|
+
/**
|
|
7
|
+
* Logged in place of a name the guard refused by the blocked-domain list but this check cannot place on
|
|
8
|
+
* it (the guards use the same list, so it should not happen): never the name itself.
|
|
9
|
+
*/
|
|
10
|
+
const UNNAMED_BLOCKED_HOST = 'blocked-domain';
|
|
11
|
+
/**
|
|
12
|
+
* The host as the entry may name it. A host on or under a blocked domain becomes the listed domain
|
|
13
|
+
* (`dnslog.cn`), whatever the reason: on a callback service the labels under it are the data being sent
|
|
14
|
+
* out (`<cookie>.dnslog.cn`), and a log keeps them for weeks. The match runs on the whole name, before
|
|
15
|
+
* any cut, so a long name cannot push the listed domain out of reach. Any other host loses its IPv6
|
|
16
|
+
* brackets and is cut to the longest DNS name.
|
|
17
|
+
*/
|
|
18
|
+
function loggedHost(host, reason) {
|
|
19
|
+
const name = host.toLowerCase().replace(/^\[|\]$/g, '');
|
|
20
|
+
const listed = blockedDomainOf(name);
|
|
21
|
+
if (listed !== null)
|
|
22
|
+
return listed;
|
|
23
|
+
return reason === 'blocked_domain' ? UNNAMED_BLOCKED_HOST : name.slice(0, MAX_HOST_CHARS);
|
|
24
|
+
}
|
|
25
|
+
/** The entry for one refusal. */
|
|
26
|
+
export function egressRefusalEntry(refusal) {
|
|
27
|
+
const { via, reason, address } = refusal;
|
|
28
|
+
const host = loggedHost(refusal.host, reason);
|
|
29
|
+
if (reason === 'blocked_domain') {
|
|
30
|
+
return {
|
|
31
|
+
msg: `[egress] ${via} refused a ${host} name: it is on Akai's blocked-domain list`,
|
|
32
|
+
event: EGRESS_REFUSED_EVENT,
|
|
33
|
+
via,
|
|
34
|
+
host,
|
|
35
|
+
reason,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const why = address ? `it resolves to the private address ${address}` : 'it is a private address';
|
|
39
|
+
return {
|
|
40
|
+
msg: `[egress] ${via} refused ${host}: ${why}`,
|
|
41
|
+
event: EGRESS_REFUSED_EVENT,
|
|
42
|
+
via,
|
|
43
|
+
host,
|
|
44
|
+
reason,
|
|
45
|
+
...(address ? { address } : {}),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The `onEgressRefused` buildCtx hands its guards: one `logger.warn(fields, msg)` per refusal. Within
|
|
50
|
+
* one ctx, the same refusal (one listed domain, or one private address, per guard) is logged once a
|
|
51
|
+
* minute at most, so a tool that retries in a loop cannot flood the log. The memory belongs to this
|
|
52
|
+
* reporter, not to the process: in a host that serves many tenants, one tenant's refusal never hides
|
|
53
|
+
* another's. Never throws.
|
|
54
|
+
*/
|
|
55
|
+
export function egressRefusalLogger(logger, now = Date.now) {
|
|
56
|
+
const lastLogged = new Map(); // `${via} ${reason} ${address | host}` -> when it was last logged
|
|
57
|
+
return (refusal) => {
|
|
58
|
+
try {
|
|
59
|
+
const { msg, ...fields } = egressRefusalEntry(refusal);
|
|
60
|
+
const key = `${fields.via} ${fields.reason} ${fields.address ?? fields.host}`;
|
|
61
|
+
const at = now();
|
|
62
|
+
const last = lastLogged.get(key);
|
|
63
|
+
if (last !== undefined && at - last < ONCE_PER_MS)
|
|
64
|
+
return;
|
|
65
|
+
if (lastLogged.size >= MAX_REMEMBERED)
|
|
66
|
+
lastLogged.clear();
|
|
67
|
+
lastLogged.set(key, at);
|
|
68
|
+
logger.warn(fields, msg);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// Best-effort: the refusal itself is thrown to the tool either way.
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** Call a guard's `onEgressRefused`, when it has one, without letting it throw into the refusal. */
|
|
76
|
+
export function reportEgressRefusal(onEgressRefused, refusal) {
|
|
77
|
+
if (onEgressRefused === undefined)
|
|
78
|
+
return;
|
|
79
|
+
try {
|
|
80
|
+
onEgressRefused(refusal);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// Best-effort, as above.
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GET `url` over `node:http` / `node:https`, connecting only to `addresses` —
|
|
3
|
+
* the answer the caller already checked — never to a fresh DNS answer, so a
|
|
4
|
+
* name that answers public first and private second (DNS rebinding) cannot
|
|
5
|
+
* move the socket. Global fetch cannot do this: it resolves the host again and
|
|
6
|
+
* takes no per-request `lookup`.
|
|
7
|
+
*
|
|
8
|
+
* - The URL's hostname still names the request: it is the `Host` header and,
|
|
9
|
+
* over TLS, the SNI name the certificate is verified against.
|
|
10
|
+
* - `agent: false` opens a fresh connection through the pinned `lookup` rather
|
|
11
|
+
* than reusing a pooled socket dialled under another answer.
|
|
12
|
+
* - Redirects come back as responses; the caller decides whether to follow one.
|
|
13
|
+
* - No `accept-encoding` is sent, so the body arrives as the server stored it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pinnedGet(url: URL, addresses: readonly string[], signal?: AbortSignal): Promise<Response>;
|
|
16
|
+
//# sourceMappingURL=pinned-get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pinned-get.d.ts","sourceRoot":"","sources":["../../src/ctx/pinned-get.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAmCzG"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { request as httpRequest } from 'node:http';
|
|
2
|
+
import { request as httpsRequest } from 'node:https';
|
|
3
|
+
import { Readable } from 'node:stream';
|
|
4
|
+
import { pinnedLookup } from './safe-fetch.js';
|
|
5
|
+
/** Response statuses that must not carry a body (the Response constructor throws otherwise). */
|
|
6
|
+
const NULL_BODY_STATUSES = new Set([204, 205, 304]);
|
|
7
|
+
/**
|
|
8
|
+
* GET `url` over `node:http` / `node:https`, connecting only to `addresses` —
|
|
9
|
+
* the answer the caller already checked — never to a fresh DNS answer, so a
|
|
10
|
+
* name that answers public first and private second (DNS rebinding) cannot
|
|
11
|
+
* move the socket. Global fetch cannot do this: it resolves the host again and
|
|
12
|
+
* takes no per-request `lookup`.
|
|
13
|
+
*
|
|
14
|
+
* - The URL's hostname still names the request: it is the `Host` header and,
|
|
15
|
+
* over TLS, the SNI name the certificate is verified against.
|
|
16
|
+
* - `agent: false` opens a fresh connection through the pinned `lookup` rather
|
|
17
|
+
* than reusing a pooled socket dialled under another answer.
|
|
18
|
+
* - Redirects come back as responses; the caller decides whether to follow one.
|
|
19
|
+
* - No `accept-encoding` is sent, so the body arrives as the server stored it.
|
|
20
|
+
*/
|
|
21
|
+
export function pinnedGet(url, addresses, signal) {
|
|
22
|
+
if (addresses.length === 0)
|
|
23
|
+
return Promise.reject(new Error(`no address to connect to for ${url.hostname}`));
|
|
24
|
+
const request = url.protocol === 'https:' ? httpsRequest : httpRequest;
|
|
25
|
+
const options = {
|
|
26
|
+
method: 'GET',
|
|
27
|
+
lookup: pinnedLookup(addresses),
|
|
28
|
+
agent: false,
|
|
29
|
+
...(signal ? { signal } : {}),
|
|
30
|
+
};
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
const req = request(url, options, (res) => {
|
|
33
|
+
// A throw in here (e.g. Response refusing a status) must reject the
|
|
34
|
+
// promise, not escape into the http module's event handling.
|
|
35
|
+
try {
|
|
36
|
+
const status = res.statusCode ?? 0;
|
|
37
|
+
// rawHeaders keeps repeated headers that the object form would join.
|
|
38
|
+
const headers = new Headers();
|
|
39
|
+
for (let i = 0; i + 1 < res.rawHeaders.length; i += 2) {
|
|
40
|
+
headers.append(res.rawHeaders[i], res.rawHeaders[i + 1]);
|
|
41
|
+
}
|
|
42
|
+
const nullBody = NULL_BODY_STATUSES.has(status);
|
|
43
|
+
if (nullBody)
|
|
44
|
+
res.resume();
|
|
45
|
+
// node:stream/web's ReadableStream and lib.dom's are the same object at
|
|
46
|
+
// runtime but distinct nominal types, so bridge through unknown.
|
|
47
|
+
const body = nullBody ? null : Readable.toWeb(res);
|
|
48
|
+
resolve(new Response(body, { status, statusText: res.statusMessage ?? '', headers }));
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
res.resume();
|
|
52
|
+
reject(err);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
req.on('error', reject);
|
|
56
|
+
req.end();
|
|
57
|
+
});
|
|
58
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
|
+
import type { EgressRefusal } from './egress-refusal.js';
|
|
2
3
|
export interface CreateReadFileStreamOptions {
|
|
3
4
|
/** Resolves and sandboxes local paths. Same function injected as `ctx.safePath`. */
|
|
4
5
|
readonly safePath: (userPath: string) => string;
|
|
5
6
|
/** Aborts in-flight `http(s)://` fetches when the tool's invocation is cancelled. */
|
|
6
7
|
readonly signal: AbortSignal;
|
|
8
|
+
/** One call per URL refused for its blocked domain or a private address (egress-refusal.ts); buildCtx logs it. */
|
|
9
|
+
readonly onEgressRefused?: (refusal: EgressRefusal) => void;
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
12
|
* Build a `ctx.readFileStream(value)` implementation — the streaming twin of
|
|
@@ -14,8 +17,8 @@ export interface CreateReadFileStreamOptions {
|
|
|
14
17
|
* in-process instead of on an isolated pod. Dispatches on the value's scheme
|
|
15
18
|
* exactly as `createReadFile`:
|
|
16
19
|
*
|
|
17
|
-
* - `http://` / `https://` →
|
|
18
|
-
*
|
|
20
|
+
* - `http://` / `https://` → the {@link fetchUrlInput} body as a `Readable`
|
|
21
|
+
* (no egress allowlist; a blocked-domain or private-address host is refused).
|
|
19
22
|
* - bare path (or `file://`) → open `safePath(value)`, then stream it.
|
|
20
23
|
*
|
|
21
24
|
* `safePath` escape attempts surface as `AkaiPathError`; HTTP failures as `Error`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-file-stream.d.ts","sourceRoot":"","sources":["../../src/ctx/read-file-stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"read-file-stream.d.ts","sourceRoot":"","sources":["../../src/ctx/read-file-stream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,WAAW,2BAA2B;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,kHAAkH;IAClH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;CAC7D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CA6B5G"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { open } from 'node:fs/promises';
|
|
2
2
|
import { Readable } from 'node:stream';
|
|
3
|
+
import { fetchUrlInput } from './url-input.js';
|
|
3
4
|
/**
|
|
4
5
|
* Build a `ctx.readFileStream(value)` implementation — the streaming twin of
|
|
5
6
|
* `ctx.readFile`. Returns a `Readable` instead of buffering the whole file, so a
|
|
@@ -9,8 +10,8 @@ import { Readable } from 'node:stream';
|
|
|
9
10
|
* in-process instead of on an isolated pod. Dispatches on the value's scheme
|
|
10
11
|
* exactly as `createReadFile`:
|
|
11
12
|
*
|
|
12
|
-
* - `http://` / `https://` →
|
|
13
|
-
*
|
|
13
|
+
* - `http://` / `https://` → the {@link fetchUrlInput} body as a `Readable`
|
|
14
|
+
* (no egress allowlist; a blocked-domain or private-address host is refused).
|
|
14
15
|
* - bare path (or `file://`) → open `safePath(value)`, then stream it.
|
|
15
16
|
*
|
|
16
17
|
* `safePath` escape attempts surface as `AkaiPathError`; HTTP failures as `Error`
|
|
@@ -28,14 +29,7 @@ export function createReadFileStream(opts) {
|
|
|
28
29
|
throw new Error('ctx.readFileStream: value must be a non-empty string');
|
|
29
30
|
}
|
|
30
31
|
if (value.startsWith('http://') || value.startsWith('https://')) {
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
response = await fetch(value, { signal });
|
|
34
|
-
}
|
|
35
|
-
catch (err) {
|
|
36
|
-
const cause = err instanceof Error ? err.message : String(err);
|
|
37
|
-
throw new Error(`ctx.readFileStream: ${value}: ${cause}`);
|
|
38
|
-
}
|
|
32
|
+
const response = await fetchUrlInput(value, { label: 'ctx.readFileStream', signal, onEgressRefused: opts.onEgressRefused });
|
|
39
33
|
if (!response.ok) {
|
|
40
34
|
throw new Error(`ctx.readFileStream: ${value}: HTTP ${response.status} ${response.statusText}`);
|
|
41
35
|
}
|
package/dist/ctx/read-file.d.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
import type { EgressRefusal } from './egress-refusal.js';
|
|
1
2
|
export interface CreateReadFileOptions {
|
|
2
3
|
/** Resolves and sandboxes local paths. Same function injected as `ctx.safePath`. */
|
|
3
4
|
readonly safePath: (userPath: string) => string;
|
|
4
5
|
/** Aborts in-flight `http(s)://` fetches when the tool's invocation is cancelled. */
|
|
5
6
|
readonly signal: AbortSignal;
|
|
7
|
+
/** One call per URL refused for its blocked domain or a private address (egress-refusal.ts); buildCtx logs it. */
|
|
8
|
+
readonly onEgressRefused?: (refusal: EgressRefusal) => void;
|
|
6
9
|
}
|
|
7
10
|
/**
|
|
8
11
|
* Build a `ctx.readFile(value)` implementation that dispatches on the value's
|
|
9
12
|
* scheme:
|
|
10
13
|
*
|
|
11
|
-
* - `http://` / `https://` →
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
+
* - `http://` / `https://` → fetched via {@link fetchUrlInput} → `Buffer`. The
|
|
15
|
+
* URL comes from the agent's tool argument, so there is no egress allowlist
|
|
16
|
+
* but the private-address rule of ctx.fetch applies: a host on the
|
|
17
|
+
* blocked-domain list, or one that resolves to a private address, is refused
|
|
18
|
+
* and reported (url-input.ts).
|
|
14
19
|
* - `file://` → strip prefix, then resolve via {@link CreateReadFileOptions.safePath}
|
|
15
20
|
* and read.
|
|
16
21
|
* - bare path → resolve via `safePath` and read.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-file.d.ts","sourceRoot":"","sources":["../../src/ctx/read-file.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"read-file.d.ts","sourceRoot":"","sources":["../../src/ctx/read-file.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,WAAW,qBAAqB;IACpC,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAChD,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,kHAAkH;IAClH,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;CAC7D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,qBAAqB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAmB9F"}
|
package/dist/ctx/read-file.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { readFile as fsReadFile } from 'node:fs/promises';
|
|
2
|
+
import { fetchUrlInput } from './url-input.js';
|
|
2
3
|
/**
|
|
3
4
|
* Build a `ctx.readFile(value)` implementation that dispatches on the value's
|
|
4
5
|
* scheme:
|
|
5
6
|
*
|
|
6
|
-
* - `http://` / `https://` →
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* - `http://` / `https://` → fetched via {@link fetchUrlInput} → `Buffer`. The
|
|
8
|
+
* URL comes from the agent's tool argument, so there is no egress allowlist
|
|
9
|
+
* but the private-address rule of ctx.fetch applies: a host on the
|
|
10
|
+
* blocked-domain list, or one that resolves to a private address, is refused
|
|
11
|
+
* and reported (url-input.ts).
|
|
9
12
|
* - `file://` → strip prefix, then resolve via {@link CreateReadFileOptions.safePath}
|
|
10
13
|
* and read.
|
|
11
14
|
* - bare path → resolve via `safePath` and read.
|
|
@@ -20,14 +23,7 @@ export function createReadFile(opts) {
|
|
|
20
23
|
throw new Error('ctx.readFile: value must be a non-empty string');
|
|
21
24
|
}
|
|
22
25
|
if (value.startsWith('http://') || value.startsWith('https://')) {
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
response = await fetch(value, { signal });
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
const cause = err instanceof Error ? err.message : String(err);
|
|
29
|
-
throw new Error(`ctx.readFile: ${value}: ${cause}`);
|
|
30
|
-
}
|
|
26
|
+
const response = await fetchUrlInput(value, { label: 'ctx.readFile', signal, onEgressRefused: opts.onEgressRefused });
|
|
31
27
|
if (!response.ok) {
|
|
32
28
|
throw new Error(`ctx.readFile: ${value}: HTTP ${response.status} ${response.statusText}`);
|
|
33
29
|
}
|
package/dist/ctx/safe-fetch.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type LookupAddress } from 'node:dns';
|
|
1
2
|
import { type LookupFunction } from 'node:net';
|
|
3
|
+
import { type EgressRefusal } from './egress-refusal.js';
|
|
2
4
|
import { type NormalizedPrivateEgressPin, type PrivateEgressPin } from './private-egress.js';
|
|
3
5
|
/**
|
|
4
6
|
* Default per-response byte cap for JSON/text `ctx.fetch` calls (override via
|
|
@@ -65,8 +67,20 @@ export interface SafeFetchBinding {
|
|
|
65
67
|
readonly privateEgress?: readonly PrivateEgressPin[];
|
|
66
68
|
/** One call per ignored {@link privateEgress} entry, with a human-readable reason. */
|
|
67
69
|
readonly onPrivateEgressInvalid?: (message: string) => void;
|
|
70
|
+
/**
|
|
71
|
+
* One call per request refused for where it would go: a blocked domain, or a private address no
|
|
72
|
+
* operator pin allows (egress-refusal.ts). buildCtx logs it; a throw here never reaches the caller.
|
|
73
|
+
* `refusal.host` holds every label of the name: log it through `egressRefusalEntry`, never as is.
|
|
74
|
+
*/
|
|
75
|
+
readonly onEgressRefused?: (refusal: EgressRefusal) => void;
|
|
68
76
|
}
|
|
69
77
|
export type SafeFetch = (url: string, init?: RequestInit) => Promise<Response>;
|
|
78
|
+
/**
|
|
79
|
+
* Whether `ip` is an address no tool may reach: loopback, unspecified, RFC 1918, link-local (the
|
|
80
|
+
* metadata address), carrier-grade NAT, IETF protocol assignments, benchmarking, multicast and the
|
|
81
|
+
* reserved 240/4 with broadcast; for IPv6 also ULA, site-local, multicast, and any form that carries a
|
|
82
|
+
* private IPv4 address. Kept in step with the worker's src/cli/lib/safe-fetch.js (AKAI-4268).
|
|
83
|
+
*/
|
|
70
84
|
export declare function isPrivateIp(ip: string): boolean;
|
|
71
85
|
/** What {@link matchPrivatePin} found: the pin that allows the call, and the addresses it is pinned to. */
|
|
72
86
|
export interface PrivatePinMatch {
|
|
@@ -113,6 +127,7 @@ type RedirectMode = 'error' | 'follow' | 'manual';
|
|
|
113
127
|
* redirect`.
|
|
114
128
|
*/
|
|
115
129
|
export declare function resolveRedirect(requested: RedirectMode | undefined): RedirectMode;
|
|
130
|
+
export declare function lookupWithSignal(hostname: string, signal: AbortSignal | undefined): Promise<LookupAddress[]>;
|
|
116
131
|
export declare function createSafeFetch(binding: SafeFetchBinding): SafeFetch;
|
|
117
132
|
/**
|
|
118
133
|
* A `lookup` that answers with the addresses safe-fetch already checked, so the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-fetch.d.ts","sourceRoot":"","sources":["../../src/ctx/safe-fetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"safe-fetch.d.ts","sourceRoot":"","sources":["../../src/ctx/safe-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAE/D,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAK/D,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAKL,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAI7B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B,QAAkB,CAAC;AAE1D;;;;;;;;GAQG;AACH,eAAO,MAAM,iCAAiC,QAAoB,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IACzC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC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