@gaunt-sloth/core 2.0.0-beta.1 → 2.0.0-beta.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/LICENSE +6 -6
- package/dist/config/loader.d.ts +13 -0
- package/dist/config/loader.js +55 -11
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +10 -0
- package/dist/config/schema.js +46 -24
- package/dist/config/schema.js.map +1 -1
- package/dist/config/shell-policy.d.ts +144 -3
- package/dist/config/shell-policy.js +117 -10
- package/dist/config/shell-policy.js.map +1 -1
- package/dist/config/tool-descriptions.d.ts +5 -5
- package/dist/config/tool-descriptions.js +3 -3
- package/dist/config/types.d.ts +19 -0
- package/dist/config/types.js.map +1 -1
- package/dist/constants.d.ts +10 -0
- package/dist/constants.js +10 -0
- package/dist/constants.js.map +1 -1
- package/dist/core/GthAbstractAgent.d.ts +32 -1
- package/dist/core/GthAbstractAgent.js +222 -7
- package/dist/core/GthAbstractAgent.js.map +1 -1
- package/dist/core/GthAgentRunner.d.ts +323 -27
- package/dist/core/GthAgentRunner.js +1092 -112
- package/dist/core/GthAgentRunner.js.map +1 -1
- package/dist/core/GthLangChainAgent.js +1 -1
- package/dist/core/GthLangChainAgent.js.map +1 -1
- package/dist/core/approvals/approvalRequest.d.ts +247 -0
- package/dist/core/approvals/approvalRequest.js +315 -0
- package/dist/core/approvals/approvalRequest.js.map +1 -0
- package/dist/core/approvals/grants.d.ts +165 -9
- package/dist/core/approvals/grants.js +702 -57
- package/dist/core/approvals/grants.js.map +1 -1
- package/dist/core/plainToolIndication.d.ts +11 -1
- package/dist/core/plainToolIndication.js +25 -10
- package/dist/core/plainToolIndication.js.map +1 -1
- package/dist/core/reasoningBlocks.d.ts +4 -6
- package/dist/core/reasoningBlocks.js +4 -6
- package/dist/core/reasoningBlocks.js.map +1 -1
- package/dist/core/shell/ShellCommandFailedError.d.ts +4 -4
- package/dist/core/shell/ShellCommandFailedError.js +4 -4
- package/dist/core/shell/abstention.d.ts +1 -1
- package/dist/core/shell/abstention.js +65 -11
- package/dist/core/shell/abstention.js.map +1 -1
- package/dist/core/shell/alignment.d.ts +491 -0
- package/dist/core/shell/alignment.js +687 -0
- package/dist/core/shell/alignment.js.map +1 -0
- package/dist/core/shell/approvalCapture.d.ts +53 -41
- package/dist/core/shell/approvalCapture.js +0 -42
- package/dist/core/shell/approvalCapture.js.map +1 -1
- package/dist/core/shell/approvalStop.d.ts +121 -3
- package/dist/core/shell/approvalStop.js +153 -90
- package/dist/core/shell/approvalStop.js.map +1 -1
- package/dist/core/shell/hardline.d.ts +26 -4
- package/dist/core/shell/hardline.js +321 -16
- package/dist/core/shell/hardline.js.map +1 -1
- package/dist/core/shell/negotiation.d.ts +352 -63
- package/dist/core/shell/negotiation.js +295 -123
- package/dist/core/shell/negotiation.js.map +1 -1
- package/dist/core/shell/openWorld.d.ts +136 -0
- package/dist/core/shell/openWorld.js +573 -35
- package/dist/core/shell/openWorld.js.map +1 -1
- package/dist/core/shell/provenance.d.ts +91 -0
- package/dist/core/shell/provenance.js +136 -0
- package/dist/core/shell/provenance.js.map +1 -0
- package/dist/core/shell/rater.d.ts +394 -163
- package/dist/core/shell/rater.js +536 -238
- package/dist/core/shell/rater.js.map +1 -1
- package/dist/core/shell/raterHealth.d.ts +101 -0
- package/dist/core/shell/raterHealth.js +121 -0
- package/dist/core/shell/raterHealth.js.map +1 -0
- package/dist/core/shell/raterModel.d.ts +17 -8
- package/dist/core/shell/raterModel.js +11 -8
- package/dist/core/shell/raterModel.js.map +1 -1
- package/dist/core/shell/rejection.d.ts +20 -5
- package/dist/core/shell/rejection.js +18 -4
- package/dist/core/shell/rejection.js.map +1 -1
- package/dist/core/toolDisplay.d.ts +91 -2
- package/dist/core/toolDisplay.js +168 -19
- package/dist/core/toolDisplay.js.map +1 -1
- package/dist/core/types.d.ts +140 -22
- package/dist/core/types.js.map +1 -1
- package/dist/providers/configurationPassthrough.d.ts +36 -6
- package/dist/providers/configurationPassthrough.js +40 -28
- package/dist/providers/configurationPassthrough.js.map +1 -1
- package/dist/providers/geminiSchemaSanitizer.d.ts +2 -2
- package/dist/providers/geminiSchemaSanitizer.js +2 -2
- package/dist/providers/geminiThinking.d.ts +10 -5
- package/dist/providers/geminiThinking.js +10 -5
- package/dist/providers/geminiThinking.js.map +1 -1
- package/dist/providers/openrouter.js +36 -6
- package/dist/providers/openrouter.js.map +1 -1
- package/dist/providers/vertexai.js +21 -0
- package/dist/providers/vertexai.js.map +1 -1
- package/dist/runtime/askStructured.d.ts +22 -0
- package/dist/runtime/askStructured.js +53 -0
- package/dist/runtime/askStructured.js.map +1 -1
- package/dist/utils/aiignoreUtils.d.ts +6 -0
- package/dist/utils/aiignoreUtils.js +69 -1
- package/dist/utils/aiignoreUtils.js.map +1 -1
- package/dist/utils/binaryOutputUtils.js +103 -21
- package/dist/utils/binaryOutputUtils.js.map +1 -1
- package/dist/utils/displayWidth.d.ts +10 -5
- package/dist/utils/displayWidth.js +148 -54
- package/dist/utils/displayWidth.js.map +1 -1
- package/dist/utils/fileUtils.d.ts +7 -1
- package/dist/utils/fileUtils.js +17 -3
- package/dist/utils/fileUtils.js.map +1 -1
- package/dist/utils/globalConfigUtils.d.ts +5 -2
- package/dist/utils/globalConfigUtils.js +14 -3
- package/dist/utils/globalConfigUtils.js.map +1 -1
- package/dist/utils/llmUtils.d.ts +1 -1
- package/dist/utils/llmUtils.js +1 -1
- package/dist/utils/systemPromptNotes.d.ts +3 -3
- package/dist/utils/systemPromptNotes.js +3 -3
- package/dist/utils/vertexaiUtils.js +160 -3
- package/dist/utils/vertexaiUtils.js.map +1 -1
- package/package.json +6 -5
- package/schema/gsloth-config.schema.json +34 -0
|
@@ -21,8 +21,17 @@
|
|
|
21
21
|
* **What it is:** a cheap, deterministic way to turn away a small set of commands we are
|
|
22
22
|
* **absolutely sure** are catastrophic and that can be recognised **without numerous annoying false
|
|
23
23
|
* positives** — wipe the root filesystem, format a disk, overwrite a raw block device, re-own the
|
|
24
|
-
* filesystem out from under root, fork-bomb
|
|
25
|
-
*
|
|
24
|
+
* filesystem out from under root, fork-bomb — plus the deterministic subset of the §4.1.1 `attack`
|
|
25
|
+
* outcome (a credential source and a network sink in one pipeline).
|
|
26
|
+
*
|
|
27
|
+
* **Taking the host down is NOT here.** `shutdown`, `reboot`, `halt`, `poweroff`, `init 0/6`,
|
|
28
|
+
* `systemctl poweroff` and `telinit 0/6` are `destructive`, not `catastrophic`: the machine comes
|
|
29
|
+
* back. §8 covers only the deterministic subset of `attack` and of `catastrophic`, so the family
|
|
30
|
+
* sits above this layer, with the rater and the confirmation dialog in front of it. Anchoring the
|
|
31
|
+
* family instead of removing it was the alternative and it is the wrong one — the floor is
|
|
32
|
+
* unappealable at every rung, so it refused `shutdown --help`, `shutdown --dry-run`, and the
|
|
33
|
+
* `shutdown -c` that CANCELS a pending shutdown, which is the command a user reaches for to PREVENT
|
|
34
|
+
* the harm.
|
|
26
35
|
*
|
|
27
36
|
* **What it is NOT: a security boundary, an ultimate defence, or complete.** It is a lexical test
|
|
28
37
|
* over the normalized command; it does not parse the shell and never will. **Incompleteness here is
|
|
@@ -78,6 +87,13 @@
|
|
|
78
87
|
* the two halves cannot come to disagree about what a separator is. Every destructive-verb pattern
|
|
79
88
|
* is anchored at {@link CMD_POS}, so a verb in an ordinary argument is not a refusal.
|
|
80
89
|
*
|
|
90
|
+
* **There are TWO pattern lists and the second is platform-gated.** {@link HARDLINE_PATTERNS} is
|
|
91
|
+
* catastrophic everywhere and is tried on every host; {@link WINDOWS_HARDLINE_PATTERNS} is tried in
|
|
92
|
+
* ADDITION when the platform is `win32`, never instead, because a Windows box also runs the POSIX
|
|
93
|
+
* shapes through Git Bash and WSL. The platform is an argument with a `process.platform` default
|
|
94
|
+
* ({@link HardlineOptions}) so both arms are reachable from any host's tests — read that docblock
|
|
95
|
+
* before adding a Windows arm, and the list's own for what it deliberately leaves out.
|
|
96
|
+
*
|
|
81
97
|
* The floor is deliberately INDEPENDENT of the allow-list classifier above it: it must block a
|
|
82
98
|
* catastrophic command even if every layer above wrongly decided that command was safe.
|
|
83
99
|
*/
|
|
@@ -144,7 +160,7 @@ const WRAPPER_ARMS = [
|
|
|
144
160
|
* Matches a position where the shell would begin parsing a NEW command: start of string, after a
|
|
145
161
|
* separator (`;` `&` `|` newline), after `$(` or a backtick, optionally consuming any run of the
|
|
146
162
|
* leading wrappers in {@link WRAPPER_ARMS}. Used by every destructive-verb pattern so a verb in an
|
|
147
|
-
* ordinary argument (`echo
|
|
163
|
+
* ordinary argument (`echo mkfs.ext4 /dev/sda1`, `grep -c mkfs docs/*.md`) is not a refusal.
|
|
148
164
|
*
|
|
149
165
|
* **What this deliberately does NOT model. This is the worked example of the header's drop rule —
|
|
150
166
|
* read it before proposing an addition.**
|
|
@@ -233,6 +249,44 @@ const CMD_POS = `(?:^|[${COMMAND_SEPARATOR_CLASS}\`]|\\$\\()` +
|
|
|
233
249
|
* because a target is the last thing before the enclosing construct resumes.
|
|
234
250
|
*/
|
|
235
251
|
const TARGET_TOKEN_END = `(?=$|[\\s)\`${COMMAND_SEPARATOR_CLASS}])`;
|
|
252
|
+
/**
|
|
253
|
+
* A prefix asserting that what follows sits OUTSIDE any single-quoted region — an even number of
|
|
254
|
+
* single quotes between the start of the normalized command and the match. Used by the
|
|
255
|
+
* redirect-to-block-device arm, the one destructive arm that {@link CMD_POS} cannot anchor.
|
|
256
|
+
*
|
|
257
|
+
* **Why this arm needs an anchor of its own.** A redirection operator appears mid-command by
|
|
258
|
+
* definition, so there is no command position to bind it to. Unanchored, the arm fires on the
|
|
259
|
+
* STRING rather than on the operation, and the floor — unappealable at every rung including
|
|
260
|
+
* `bypass` — refuses `grep '> /dev/sda' install.log`, `echo 'wrote image > /dev/sdb'`, and
|
|
261
|
+
* `sed -i 's|> /dev/sda|> /dev/null|' script.sh`, which is the command someone runs to REMOVE a
|
|
262
|
+
* dangerous redirect from a script. The remediation being refused is what makes this a defect
|
|
263
|
+
* rather than noise.
|
|
264
|
+
*
|
|
265
|
+
* **SINGLE quotes only, and that is measured rather than aesthetic.** A scanner for this floor that
|
|
266
|
+
* tracked escapes and heredocs precisely leaked 6 of 12 attacks where a blunt single-quote one
|
|
267
|
+
* leaked 0: precision moved the decision onto a surface the attacker controls. Double quotes are
|
|
268
|
+
* deliberately NOT a region here either — treating them as one would newly hide
|
|
269
|
+
* `sh -c "cat img > /dev/sda"` and `bash -c "…"`, live shapes, to buy the refusal of
|
|
270
|
+
* `echo "wrote image > /dev/sdb"`, which nobody has hit. So a double-quoted mention stays refused.
|
|
271
|
+
*
|
|
272
|
+
* **What it gives up** is one rule and nothing else: every `> /dev/<blockdev>` preceded by an ODD
|
|
273
|
+
* number of single quotes in the normalized command, which is where the redirect reads as sitting
|
|
274
|
+
* inside a quoted region. That rule is the specification of the set; `shellHardline.spec.ts` pins a
|
|
275
|
+
* named SAMPLE of it rather than an enumeration, so a shape that satisfies the rule and is absent
|
|
276
|
+
* there is a declared miss all the same, and the rule is what to check a new one against. The
|
|
277
|
+
* commonest is `sh -c 'cat img > /dev/sda'` — already the interpreter-wrapper residual every other
|
|
278
|
+
* arm has. They execute, and they are misses this layer accepts: a miss keeps the rater and the
|
|
279
|
+
* confirmation dialog, an unappealable false positive keeps nothing. [[CFG-29]] span extraction is
|
|
280
|
+
* the discriminator that would close them.
|
|
281
|
+
*
|
|
282
|
+
* **Linear, not backtracking.** `[^']*` cannot cross a `'`, so each iteration's partition is forced
|
|
283
|
+
* and the outer `*` is bounded by the quote count — no ambiguity for the engine to explore. The
|
|
284
|
+
* lesson {@link CMD_POS} records about Fibonacci-many parses does not reach this shape, and
|
|
285
|
+
* `shellHardline.spec.ts` measures that rather than arguing it, on quotes interleaved with other
|
|
286
|
+
* characters — a run of ADJACENT quotes is deleted by {@link normalizeCommand} as a token-splitting
|
|
287
|
+
* artefact and never reaches this scan at all.
|
|
288
|
+
*/
|
|
289
|
+
const OUTSIDE_SINGLE_QUOTES = "^(?:[^']*'[^']*')*[^']*";
|
|
236
290
|
/**
|
|
237
291
|
* A target path, in the three spellings a shell accepts for the same file: bare, double-quoted,
|
|
238
292
|
* single-quoted. `rm -rf "/"` deletes exactly what `rm -rf /` deletes.
|
|
@@ -361,9 +415,12 @@ const CHOWN_HEAD = CMD_POS +
|
|
|
361
415
|
* asked for no gate. A false positive in this layer has no recovery at any rung; a miss still has
|
|
362
416
|
* the layers above it. The floor stays narrow and accepts the misses.
|
|
363
417
|
*
|
|
364
|
-
* Two patterns
|
|
365
|
-
* `>`-redirect-to-device arm
|
|
366
|
-
*
|
|
418
|
+
* Two patterns carry no {@link CMD_POS} anchor, because neither is a command-position construct.
|
|
419
|
+
* The `>`-redirect-to-device arm is anchored differently instead — see
|
|
420
|
+
* {@link OUTSIDE_SINGLE_QUOTES} — because a redirection operator appears mid-command by definition,
|
|
421
|
+
* so the discrimination available to it is whether the `>` is QUOTED, not where it sits. The
|
|
422
|
+
* fork-bomb literal is anchored by nothing at all: the string *is* the fork bomb, so prose quoting
|
|
423
|
+
* it is refused, and that false positive is accepted rather than fixed.
|
|
367
424
|
*/
|
|
368
425
|
export const HARDLINE_PATTERNS = [
|
|
369
426
|
// rm -rf targeting the root filesystem (`/`, `/*`). Built with `new RegExp` so both the tail and
|
|
@@ -392,8 +449,13 @@ export const HARDLINE_PATTERNS = [
|
|
|
392
449
|
new RegExp(CMD_POS + 'dd\\b[^\\n]*\\bof=/dev/(?:sd|nvme|hd|mmcblk|vd|xvd)[a-z0-9]*'),
|
|
393
450
|
'dd to raw block device',
|
|
394
451
|
],
|
|
395
|
-
// Shell redirection to a raw block device (`> /dev/sda`).
|
|
396
|
-
|
|
452
|
+
// Shell redirection to a raw block device (`> /dev/sda`). Anchored OUTSIDE single quotes rather
|
|
453
|
+
// than at a command position — a redirection operator has no command position — so a MENTION of a
|
|
454
|
+
// redirect is not read as performing one.
|
|
455
|
+
[
|
|
456
|
+
new RegExp(OUTSIDE_SINGLE_QUOTES + '>\\s*/dev/(?:sd|nvme|hd|mmcblk|vd|xvd)[a-z0-9]*\\b'),
|
|
457
|
+
'redirect to raw block device',
|
|
458
|
+
],
|
|
397
459
|
// Classic fork bomb `:(){ :|:& };:`.
|
|
398
460
|
[/:\s*\(\s*\)\s*\{\s*:\s*\|\s*:\s*&\s*\}\s*;\s*:/, 'fork bomb'],
|
|
399
461
|
// Recursive chmod of root, and the same on a named system directory.
|
|
@@ -440,15 +502,234 @@ export const HARDLINE_PATTERNS = [
|
|
|
440
502
|
// unappealably. Requiring a preceding token keeps `kill -9 -1`, `kill -HUP -1` and `kill -- -1`,
|
|
441
503
|
// and drops only `kill -1` with no PID, which is a usage error rather than a kill-all.
|
|
442
504
|
[new RegExp(CMD_POS + 'kill\\s+(?:-[^\\s]+\\s+)+-1\\b'), 'kill all processes'],
|
|
443
|
-
//
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
505
|
+
// The shutdown family is NOT here — see "Taking the host down is NOT here" in the module header.
|
|
506
|
+
];
|
|
507
|
+
/* -------------------------------------------------------------------------------------------- *
|
|
508
|
+
* §8 — the WINDOWS arm. Tried only when the host platform is `win32`.
|
|
509
|
+
*
|
|
510
|
+
* **Why a separate list rather than more entries above.** The patterns above are catastrophic on
|
|
511
|
+
* every host; these are catastrophic only where they name real objects. `format` is a word a Linux
|
|
512
|
+
* agent writes into a deployment script, `del` and `rd` are ordinary words, and `diskpart` is a
|
|
513
|
+
* string someone greps for. Refusing them off-platform would be an unappealable refusal of prose,
|
|
514
|
+
* which is the defect class {@link CMD_POS} exists to record. Gating costs one comparison and
|
|
515
|
+
* removes the whole class, so the two lists never merge.
|
|
516
|
+
*
|
|
517
|
+
* **The POSIX list stays active on win32.** Nothing here replaces it: Git Bash, MSYS and WSL all
|
|
518
|
+
* run `rm -rf /` on a Windows box, and removing an arm from a platform would be a NARROWING of the
|
|
519
|
+
* kind the module header forbids without a pinned removal set. The win32 arm is purely additive.
|
|
520
|
+
*
|
|
521
|
+
* **WHICH SHELL THE REUSED HELPERS MODEL — read this before adding an arm.** {@link CMD_POS} and
|
|
522
|
+
* {@link TARGET_TOKEN_END} model **bash**, and they are reused here on a stated claim rather than
|
|
523
|
+
* by assumption. What carries over is exact: the separators they recognise (`;`, `&`, `|`, a line
|
|
524
|
+
* break) are also cmd.exe's and PowerShell's, and a token still ends at whitespace or end of input
|
|
525
|
+
* in all three. What does NOT carry over is the escape character. A backtick is PowerShell's
|
|
526
|
+
* ESCAPE, not a command substitution, and `^` is cmd.exe's, and {@link normalizeCommand} collapses
|
|
527
|
+
* neither. So `` r`emove-item -recurse c:\ `` and `de^l /s /q c:\` walk past this arm. **Those are
|
|
528
|
+
* MISSES, and misses are the direction this floor errs in** — the rater and the confirmation
|
|
529
|
+
* dialog stand behind them at every rung but `bypass`. The one place the bash reading is instead
|
|
530
|
+
* over-broad is a literal backtick immediately preceding a floored Windows verb, where bash would
|
|
531
|
+
* open a command and PowerShell would escape a character; that is a false positive nobody has hit
|
|
532
|
+
* and it is written down here rather than patched speculatively.
|
|
533
|
+
*
|
|
534
|
+
* **THE NORMALIZER COLLAPSES BACKSLASHES, AND EVERY TARGET BELOW IS WRITTEN FOR WHAT SURVIVES.**
|
|
535
|
+
* {@link normalizeCommand} folds `\x` to `x` (it is what stops `r\m -rf /`), so a Windows path
|
|
536
|
+
* arrives here with most of its separators gone: `C:\Windows\System32` is `c:windowssystem32`,
|
|
537
|
+
* `HKLM\SOFTWARE` is `hklmsoftware`, `.\dist` is `.dist`, and `\\?\C:\` is `\?c:\`. A trailing
|
|
538
|
+
* backslash survives only at end of input, and `C:\` followed by a space is just `c:`. Reading a
|
|
539
|
+
* pattern below as though it matched the command a user typed will therefore mislead in both
|
|
540
|
+
* directions — match them against the normalized form, which is what the specs assert on.
|
|
541
|
+
*
|
|
542
|
+
* The consequence that shapes the design: after the collapse a Windows path has **no separator
|
|
543
|
+
* left to bind a tail against**, so the discrimination POSIX gets for free from the `/` in
|
|
544
|
+
* `/etc/foo` has to come from the drive-letter colon and an enumerated directory name instead.
|
|
545
|
+
* That is why the drive-root arms are broad and the named-directory arm is a short enumeration.
|
|
546
|
+
* -------------------------------------------------------------------------------------------- */
|
|
547
|
+
/**
|
|
548
|
+
* A run of Windows flag tokens. Identical in shape to the POSIX flag runs above — bounded per
|
|
549
|
+
* token by the required trailing whitespace — but a Windows flag may start with `/` as well as
|
|
550
|
+
* `-`, because cmd.exe and PowerShell disagree about which one they use and both spellings reach
|
|
551
|
+
* the same verbs.
|
|
552
|
+
*/
|
|
553
|
+
const WIN_FLAG_RUN = '(?:[-/][^\\s]*\\s+)*';
|
|
554
|
+
/**
|
|
555
|
+
* The span of ONE command, for the lookaheads below: anything that is not a separator. It is what
|
|
556
|
+
* keeps a flag belonging to a LATER command out of an earlier one's reading, so `icacls c:\ /grant
|
|
557
|
+
* everyone:f; ls /t` cannot borrow the `/t` from the `ls`.
|
|
558
|
+
*/
|
|
559
|
+
const WIN_SAME_COMMAND = `[^${COMMAND_SEPARATOR_CLASS}]*`;
|
|
560
|
+
/**
|
|
561
|
+
* How a Windows system drive is NAMED, before any trailing separator: a drive letter and its
|
|
562
|
+
* colon, optionally behind the `\\?\` long-path prefix (which normalisation leaves as `\?`), or
|
|
563
|
+
* the two environment spellings of the same thing — cmd's `%SystemDrive%` and PowerShell's
|
|
564
|
+
* `$env:SystemDrive`.
|
|
565
|
+
*
|
|
566
|
+
* The colon is what makes this bindable at all. Every other character of a collapsed Windows path
|
|
567
|
+
* is an ordinary letter, so without the colon there would be nothing to distinguish `c:` from the
|
|
568
|
+
* first letter of a relative path.
|
|
569
|
+
*/
|
|
570
|
+
const WIN_DRIVE_PREFIX = '(?:(?:\\\\\\?)?[a-z]:|%systemdrive%|\\$env:systemdrive)';
|
|
571
|
+
/**
|
|
572
|
+
* What may follow a Windows target before its token ends: a separator (`\` or `/`), a wildcard, or
|
|
573
|
+
* both. `C:\` reaches here as `c:\` at end of input, as `c:` before a space, and `C:\*` as `c:*`,
|
|
574
|
+
* so all three have to be one optional group.
|
|
575
|
+
*/
|
|
576
|
+
const WIN_ROOT_TAIL = '(?:[\\\\/]?\\*|[\\\\/])?';
|
|
577
|
+
/**
|
|
578
|
+
* A Windows drive ROOT as a target. The {@link TARGET_TOKEN_END} tail that {@link quotedOrBare}
|
|
579
|
+
* appends is what does the work: without it `c:` matches the first two characters of every
|
|
580
|
+
* absolute Windows path, and `rd /s /q c:\build` — ordinary work — would be refused unappealably.
|
|
581
|
+
* With it, the token has to END at the drive, so `c:build` and `c:/users/me/app` are out of range
|
|
582
|
+
* for the same reason `/var/www/html` is out of range on the POSIX side.
|
|
583
|
+
*/
|
|
584
|
+
const WIN_DRIVE_ROOT = quotedOrBare(WIN_DRIVE_PREFIX + WIN_ROOT_TAIL);
|
|
585
|
+
/**
|
|
586
|
+
* The Windows system directory as a target — `C:\Windows` and `C:\Windows\System32`, plus the
|
|
587
|
+
* `%SystemRoot%` / `$env:windir` spellings of the first.
|
|
588
|
+
*
|
|
589
|
+
* **The two depths are ENUMERATED, and the hole that leaves is declared rather than argued away.**
|
|
590
|
+
* Because the backslash collapse leaves `c:windowssystem32` with no separator, a tail cannot bind
|
|
591
|
+
* part-way through the way it can after `/etc`; each depth is its own alternative. So a deeper
|
|
592
|
+
* system path (`C:\Windows\System32\drivers`) is NOT matched. That is the same shape of residual
|
|
593
|
+
* the POSIX arms carry — `/etc/foo` is equally out of range — and it errs toward a miss, which is
|
|
594
|
+
* this floor's safe direction.
|
|
595
|
+
*
|
|
596
|
+
* The tail still has to bind, which is what keeps `C:\Windows.old` (a leftover upgrade directory
|
|
597
|
+
* people delete on purpose) and `C:\WindowsApps\…` out of range.
|
|
598
|
+
*/
|
|
599
|
+
const WIN_SYSTEM_DIR_TARGET = quotedOrBare(`(?:${WIN_DRIVE_PREFIX}[\\\\/]?windows(?:[\\\\/]?system32)?|%systemroot%|\\$env:windir)` +
|
|
600
|
+
WIN_ROOT_TAIL);
|
|
601
|
+
/**
|
|
602
|
+
* The delete verbs, in one alternation because cmd.exe and PowerShell share most of them.
|
|
603
|
+
* `remove-item` is the PowerShell cmdlet and `ri`/`rm`/`rd`/`rmdir`/`del`/`erase` are all aliases
|
|
604
|
+
* of it, while `rd`/`rmdir`/`del`/`erase` are simultaneously cmd.exe's own builtins. One list
|
|
605
|
+
* covers both shells, and the target is what carries the discrimination.
|
|
606
|
+
*
|
|
607
|
+
* **No flag is required, deliberately, and that mirrors the POSIX `rm` arm** — which also requires
|
|
608
|
+
* none, because a verb pointed at the root of a filesystem is the catastrophe whether or not the
|
|
609
|
+
* recursion flag is spelled. The `chown`/`chmod` analogues below DO require recursion, for the
|
|
610
|
+
* same reason their POSIX siblings do: without it they touch one directory entry rather than every
|
|
611
|
+
* file on the disk.
|
|
612
|
+
*/
|
|
613
|
+
const WIN_DELETE_VERB = '(?:remove-item|rmdir|erase|del|rd|ri|rm)';
|
|
614
|
+
/**
|
|
615
|
+
* The Windows system drive as **Git Bash and Cygwin spell it**. Git for Windows mounts `C:` at
|
|
616
|
+
* `/c`, Cygwin at `/cygdrive/c`, and both spellings reach the real system drive while `rm -rf /`
|
|
617
|
+
* on the same box reaches only the MSYS root — the least harmful of the three.
|
|
618
|
+
*
|
|
619
|
+
* **It is on the win32 arm rather than folded into {@link SYSTEM_DIR_TARGET}, and that is the
|
|
620
|
+
* deliberate half.** Folding it in would widen a shared pattern, which is the one edit that could
|
|
621
|
+
* regress the POSIX behaviour this node must leave untouched — and on Linux `/c/users` is an
|
|
622
|
+
* ordinary directory nobody may be refused for deleting. `process.platform` is `win32` under Git
|
|
623
|
+
* Bash and Cygwin alike, so gating loses no coverage. **WSL is NOT covered**: it reports `linux`
|
|
624
|
+
* and mounts the drive at `/mnt/c`, so that spelling is a declared miss.
|
|
625
|
+
*
|
|
626
|
+
* The user-profile and system directories are enumerated one level down for the same reason the
|
|
627
|
+
* POSIX arm names `/home` — `/c/users` is every account on the machine.
|
|
628
|
+
*/
|
|
629
|
+
const GIT_BASH_DRIVE_TARGET = quotedOrBare('(?:/cygdrive)?/[a-z](?:/(?:users|windows|programdata))?(?:/\\*?)?');
|
|
630
|
+
/**
|
|
631
|
+
* A MACHINE registry hive as a target: the whole of `HKLM` or `HKCR`, or the two subtrees whose
|
|
632
|
+
* loss is not survivable — `HKLM\SOFTWARE` unregisters every installed application and
|
|
633
|
+
* `HKLM\SYSTEM` stops the machine booting.
|
|
634
|
+
*
|
|
635
|
+
* The {@link TARGET_TOKEN_END} tail is doing the same job it does for the filesystem targets, and
|
|
636
|
+
* here it is what separates the catastrophe from the everyday: after the backslash collapse
|
|
637
|
+
* `HKLM\SOFTWARE\MyApp` is `hklmsoftwaremyapp`, so requiring the token to END at the hive is what
|
|
638
|
+
* leaves an application deleting its OWN key alone. `HKCU` is deliberately absent — a user hive is
|
|
639
|
+
* recoverable by logging in again.
|
|
640
|
+
*/
|
|
641
|
+
const WIN_MACHINE_HIVE = quotedOrBare('(?:(?:hklm|hkey_local_machine)(?:[\\\\/]?(?:software|system))?|hkcr|hkey_classes_root)');
|
|
642
|
+
/**
|
|
643
|
+
* The win32-only patterns, in the same `[regex, description]` shape as {@link HARDLINE_PATTERNS}
|
|
644
|
+
* and subject to every rule in the module header — including that a miss here is cheap and a false
|
|
645
|
+
* positive is unappealable.
|
|
646
|
+
*
|
|
647
|
+
* **What is deliberately NOT here, so the residual is a decision rather than an oversight:**
|
|
648
|
+
*
|
|
649
|
+
* - **The host-down family** — `shutdown /s`, `shutdown /r`, `Stop-Computer`, `Restart-Computer`.
|
|
650
|
+
* They are `destructive`, not `catastrophic`, under the same ruling that removed their POSIX
|
|
651
|
+
* siblings; the machine comes back. `shellHardline.spec.ts` pins them as non-additions so this
|
|
652
|
+
* arm cannot quietly re-open a settled classification on one platform.
|
|
653
|
+
* - **`cipher /w:`** — it overwrites FREE space. Nothing in use is lost and the machine is
|
|
654
|
+
* unaffected, so it fails the catastrophic test even though it destroys recoverability.
|
|
655
|
+
* - **`bcdedit /set … recoveryenabled No`** — a setting flip, undone by the opposite flip. It is a
|
|
656
|
+
* ransomware precursor, not a loss.
|
|
657
|
+
* - **`taskkill /f /im *`** — the wildcard image name is documented as accepted only alongside a
|
|
658
|
+
* filter, so the bare form may be a usage error. Flooring a command that does nothing buys
|
|
659
|
+
* nothing and puts a pattern next to the ordinary `taskkill /f /im node.exe`; the POSIX
|
|
660
|
+
* `kill -9 -1` arm covers the shape where it is known to bite.
|
|
661
|
+
* - **The interpreter-wrapper forms** — `powershell -Command "…"` and `cmd /c "…"` put the verb
|
|
662
|
+
* inside a quoted ARGUMENT, exactly as `sh -c "…"` does above, and are uncovered on the same
|
|
663
|
+
* basis. This matters more here than it looks: `run_shell_command` spawns **cmd.exe** on win32,
|
|
664
|
+
* so the cmd verbs are the ones actually reachable and the PowerShell cmdlets are reachable only
|
|
665
|
+
* where the model writes PowerShell idioms anyway, or a future config points the tool at `pwsh`.
|
|
666
|
+
*/
|
|
667
|
+
const WINDOWS_HARDLINE_PATTERNS = [
|
|
668
|
+
// Delete of a drive root, in both shells' spellings.
|
|
669
|
+
[
|
|
670
|
+
new RegExp(CMD_POS + WIN_DELETE_VERB + '\\s+' + WIN_FLAG_RUN + WIN_DRIVE_ROOT),
|
|
671
|
+
'recursive delete of a Windows drive root',
|
|
672
|
+
],
|
|
673
|
+
// The same verbs pointed at the system directory.
|
|
674
|
+
[
|
|
675
|
+
new RegExp(CMD_POS + WIN_DELETE_VERB + '\\s+' + WIN_FLAG_RUN + WIN_SYSTEM_DIR_TARGET),
|
|
676
|
+
'recursive delete of the Windows system directory',
|
|
677
|
+
],
|
|
678
|
+
// The Git Bash / Cygwin spelling of the system drive, on the POSIX verb that reaches it.
|
|
679
|
+
[
|
|
680
|
+
new RegExp(CMD_POS + 'rm\\s+(?:-[^\\s]*\\s+)*' + GIT_BASH_DRIVE_TARGET),
|
|
681
|
+
'recursive delete of the Windows system drive',
|
|
682
|
+
],
|
|
683
|
+
// `format C: /y`. The drive-letter OPERAND is required, which is what keeps `Format-Table`,
|
|
684
|
+
// `Format-List` and `git format-patch` out of range — each has a `-` where this needs whitespace.
|
|
685
|
+
[new RegExp(CMD_POS + 'format\\s+' + WIN_FLAG_RUN + WIN_DRIVE_ROOT), 'format a Windows drive'],
|
|
686
|
+
// The storage cmdlets, bare: every invocation of them destroys a volume or a disk. Anchored, so
|
|
687
|
+
// `get-help format-volume` is a lookup rather than a refusal. Same accepted cost as `mkfs`.
|
|
688
|
+
[new RegExp(CMD_POS + 'format-volume\\b'), 'format a Windows volume'],
|
|
689
|
+
[new RegExp(CMD_POS + 'clear-disk\\b'), 'wipe a Windows disk'],
|
|
690
|
+
[new RegExp(CMD_POS + 'diskpart\\b'), 'Windows disk partitioning (diskpart)'],
|
|
691
|
+
// Destroying the shadow copies is what makes an encryption pass unrecoverable, and it is the
|
|
692
|
+
// single most reliable ransomware precursor there is. `vssadmin list shadows` is read-only and
|
|
693
|
+
// stays allowed, which is why the arm requires the verb and not merely the tool.
|
|
694
|
+
[
|
|
695
|
+
new RegExp(CMD_POS + 'vssadmin\\s+' + WIN_FLAG_RUN + 'delete\\s+shadows\\b'),
|
|
696
|
+
'delete the Windows shadow copies',
|
|
697
|
+
],
|
|
447
698
|
[
|
|
448
|
-
new RegExp(CMD_POS + '
|
|
449
|
-
'
|
|
699
|
+
new RegExp(CMD_POS + 'wmic\\b' + WIN_SAME_COMMAND + 'shadowcopy\\b' + WIN_SAME_COMMAND + 'delete\\b'),
|
|
700
|
+
'delete the Windows shadow copies',
|
|
701
|
+
],
|
|
702
|
+
// `reg delete` of a machine hive. `reg query` and `reg export` are read-only and cannot reach it.
|
|
703
|
+
[
|
|
704
|
+
new RegExp(CMD_POS + 'reg\\s+delete\\s+' + WIN_MACHINE_HIVE),
|
|
705
|
+
'delete a Windows machine registry hive',
|
|
706
|
+
],
|
|
707
|
+
// `takeown /f C:\ /r` — the `chown -R /` analogue, and the worse of the pair for the same reason
|
|
708
|
+
// `chown` is worse than `chmod`: it takes ownership AWAY, so the box can no longer repair itself.
|
|
709
|
+
// `/r` is required (a non-recursive takeown re-owns one directory entry). It is asserted by a
|
|
710
|
+
// lookahead taken FROM THE VERB rather than from the target, because `takeown /r /f C:\` and
|
|
711
|
+
// `takeown /f C:\ /r` are both real invocations and a lookahead placed after the target can only
|
|
712
|
+
// see the second — measured, that spelling was allowed.
|
|
713
|
+
[
|
|
714
|
+
new RegExp(CMD_POS +
|
|
715
|
+
'takeown\\b' +
|
|
716
|
+
`(?=${WIN_SAME_COMMAND}\\s/r\\b)` +
|
|
717
|
+
WIN_SAME_COMMAND +
|
|
718
|
+
'\\s/f\\s+' +
|
|
719
|
+
WIN_DRIVE_ROOT),
|
|
720
|
+
'recursive takeown of a Windows drive root',
|
|
721
|
+
],
|
|
722
|
+
// `icacls C:\ /grant Everyone:F /t` — the `chmod -R /` analogue. BOTH lookaheads are required and
|
|
723
|
+
// the second is not decoration: `/t` alone would refuse `icacls C:\ /save acl.txt /t`, which is a
|
|
724
|
+
// recursive BACKUP of the ACLs and the command an administrator runs before changing them.
|
|
725
|
+
[
|
|
726
|
+
new RegExp(CMD_POS +
|
|
727
|
+
'icacls\\s+' +
|
|
728
|
+
WIN_DRIVE_ROOT +
|
|
729
|
+
`(?=${WIN_SAME_COMMAND}\\s/t\\b)` +
|
|
730
|
+
`(?=${WIN_SAME_COMMAND}\\s/(?:grant|deny|remove|reset|setowner)\\b)`),
|
|
731
|
+
'recursive ACL rewrite of a Windows drive root',
|
|
450
732
|
],
|
|
451
|
-
[new RegExp(CMD_POS + 'telinit\\s+[06]\\b'), 'telinit 0/6 (shutdown/reboot)'],
|
|
452
733
|
];
|
|
453
734
|
/* -------------------------------------------------------------------------------------------- *
|
|
454
735
|
* §8 — the DETERMINISTIC SUBSET OF THE `attack` OUTCOME.
|
|
@@ -690,6 +971,7 @@ export const HARDLINE_PATTERN_SURFACE = Object.freeze({
|
|
|
690
971
|
WRAPPER_ARMS: Object.freeze([...WRAPPER_ARMS]),
|
|
691
972
|
CMD_POS,
|
|
692
973
|
TARGET_TOKEN_END,
|
|
974
|
+
OUTSIDE_SINGLE_QUOTES,
|
|
693
975
|
H_SPACE,
|
|
694
976
|
H_TOKEN_EXCLUSIONS,
|
|
695
977
|
H_TOKEN_CHAR,
|
|
@@ -704,6 +986,19 @@ export const HARDLINE_PATTERN_SURFACE = Object.freeze({
|
|
|
704
986
|
// reworded one is not a narrowing, so they stay out rather than train a reader to update the
|
|
705
987
|
// frozen literal without reading why the cell went red.
|
|
706
988
|
HARDLINE_PATTERNS: Object.freeze(HARDLINE_PATTERNS.map(([pattern]) => String(pattern))),
|
|
989
|
+
// The win32-only arm and the fragments it is built from. Enrolled on exactly the same terms as
|
|
990
|
+
// the shared arm: a narrowing here is invisible on four of five matrix cells, so it needs the
|
|
991
|
+
// declaration more than the POSIX half does, not less.
|
|
992
|
+
WIN_FLAG_RUN,
|
|
993
|
+
WIN_SAME_COMMAND,
|
|
994
|
+
WIN_DRIVE_PREFIX,
|
|
995
|
+
WIN_ROOT_TAIL,
|
|
996
|
+
WIN_DRIVE_ROOT,
|
|
997
|
+
WIN_SYSTEM_DIR_TARGET,
|
|
998
|
+
WIN_DELETE_VERB,
|
|
999
|
+
GIT_BASH_DRIVE_TARGET,
|
|
1000
|
+
WIN_MACHINE_HIVE,
|
|
1001
|
+
WINDOWS_HARDLINE_PATTERNS: Object.freeze(WINDOWS_HARDLINE_PATTERNS.map(([pattern]) => String(pattern))),
|
|
707
1002
|
// The exfiltration arms.
|
|
708
1003
|
PIPELINE_SPLIT_RE: String(PIPELINE_SPLIT_RE),
|
|
709
1004
|
NETWORK_SINK_RE: String(NETWORK_SINK_RE),
|
|
@@ -745,14 +1040,24 @@ export const EXFILTRATION_ARM = 'deterministic-exfiltration';
|
|
|
745
1040
|
* Check a raw command against the hardline blocklist. Normalizes first so
|
|
746
1041
|
* obfuscated variants are caught. Returns the match (with a description) when the
|
|
747
1042
|
* command is catastrophic, or `null` when it is allowed to proceed.
|
|
1043
|
+
*
|
|
1044
|
+
* The shared patterns are tried on every host. The win32 arm is tried in addition on Windows —
|
|
1045
|
+
* never instead of, because Git Bash, MSYS and WSL run the POSIX shapes on a Windows box too.
|
|
748
1046
|
*/
|
|
749
|
-
export function checkHardline(command) {
|
|
1047
|
+
export function checkHardline(command, options) {
|
|
750
1048
|
const normalized = normalizeCommand(command).toLowerCase();
|
|
751
1049
|
for (const [pattern, description] of HARDLINE_PATTERNS) {
|
|
752
1050
|
if (pattern.test(normalized)) {
|
|
753
1051
|
return { description, pattern: pattern.source };
|
|
754
1052
|
}
|
|
755
1053
|
}
|
|
1054
|
+
if ((options?.platform ?? process.platform) === 'win32') {
|
|
1055
|
+
for (const [pattern, description] of WINDOWS_HARDLINE_PATTERNS) {
|
|
1056
|
+
if (pattern.test(normalized)) {
|
|
1057
|
+
return { description, pattern: pattern.source };
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
756
1061
|
// §3/§8 — the deterministic subset of the `attack` outcome, so refusing a credential upload does
|
|
757
1062
|
// not depend on a model being right, and cannot be ridden through on an allow-list entry
|
|
758
1063
|
// (consulted before the rater).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hardline.js","sourceRoot":"","sources":["../../../src/core/shell/hardline.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hardline.js","sourceRoot":"","sources":["../../../src/core/shell/hardline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkGG;AACH,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEzF;;;GAGG;AACH,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,YAAY,GAAsB;IACtC,6FAA6F;IAC7F,sEAAsE;IACtE,iGAAiG;IACjG,yBAAyB;IACzB,mEAA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