harden sandbox escape vectors for bash disabled/restricted modes (#257)

* harden sandbox escape vectors for bash disabled/restricted modes

block git config injection (-c flag as subcommand), dangerous subcommands
(config, submodule, rebase, bisect), code-executing arg flags (--exec,
--extcmd), .gitattributes/.gitmodules writes, and package lifecycle scripts.
add retry logic to test runner for transient failures. add security unit
tests and adhoc attack tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

* only filter subcommands in nobash, remove nobash from ui

* use regex matching

* iterate on tests

* simplify githooks

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
David Blass
2026-02-11 02:02:41 +00:00
committed by pullfrog[bot]
parent f37d02b292
commit bc28c658f2
32 changed files with 2515 additions and 1048 deletions
+24 -26
View File
@@ -15,11 +15,11 @@ importers:
specifier: 0.2.39
version: 0.2.39(zod@4.3.5)
'@ark/fs':
specifier: 0.53.0
version: 0.53.0
specifier: 0.56.0
version: 0.56.0
'@ark/util':
specifier: 0.53.0
version: 0.53.0
specifier: 0.56.0
version: 0.56.0
'@octokit/plugin-throttling':
specifier: ^11.0.3
version: 11.0.3(@octokit/core@7.0.5)
@@ -41,9 +41,12 @@ importers:
'@toon-format/toon':
specifier: ^1.0.0
version: 1.4.0
arkregex:
specifier: 0.0.5
version: 0.0.5
arktype:
specifier: 2.1.28
version: 2.1.28
specifier: 2.1.29
version: 2.1.29
dotenv:
specifier: ^17.2.3
version: 17.2.3
@@ -52,7 +55,7 @@ importers:
version: 9.6.0
fastmcp:
specifier: ^3.26.8
version: 3.26.8(arktype@2.1.28)(hono@4.11.3)
version: 3.26.8(arktype@2.1.29)(hono@4.11.3)
file-type:
specifier: ^21.3.0
version: 21.3.0
@@ -117,15 +120,12 @@ packages:
peerDependencies:
zod: ^4.0.0
'@ark/fs@0.53.0':
resolution: {integrity: sha512-XL0EbBAZgyy+j9aPhftYaBsbKAW5PTNSKCN6oLRRdrHuHPSAZgR6765/z0YZGhPxHEUNmq0vBoSk8yOLk91dNQ==}
'@ark/fs@0.56.0':
resolution: {integrity: sha512-zY/wDDhcvmt6/upQwZM766PAnvIzdEMcgydUGd9pqY9FMGNo9I9uE4RYAfms9AeUUtbZJu2h2Ua0tvFsO5XF4Q==}
'@ark/schema@0.56.0':
resolution: {integrity: sha512-ECg3hox/6Z/nLajxXqNhgPtNdHWC9zNsDyskwO28WinoFEnWow4IsERNz9AnXRhTZJnYIlAJ4uGn3nlLk65vZA==}
'@ark/util@0.53.0':
resolution: {integrity: sha512-TGn4gLlA6dJcQiqrtCtd88JhGb2XBHo6qIejsDre+nxpGuUVW4G3YZGVrwjNBTO0EyR+ykzIo4joHJzOj+/cpA==}
'@ark/util@0.56.0':
resolution: {integrity: sha512-BghfRC8b9pNs3vBoDJhcta0/c1J1rsoS1+HgVUreMFPdhz/CRAKReAu57YEllNaSy98rWAdY1gE+gFup7OXpgA==}
@@ -853,11 +853,11 @@ packages:
arg@5.0.2:
resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==}
arkregex@0.0.4:
resolution: {integrity: sha512-biS/FkvSwQq59TZ453piUp8bxMui11pgOMV9WHAnli1F8o0ayNCZzUwQadL/bGIUic5TkS/QlPcyMuI8ZIwedQ==}
arkregex@0.0.5:
resolution: {integrity: sha512-ncYjBdLlh5/QnVsAA8De16Tc9EqmYM7y/WU9j+236KcyYNUXogpz3sC4ATIZYzzLxwI+0sEOaQLEmLmRleaEXw==}
arktype@2.1.28:
resolution: {integrity: sha512-LVZqXl2zWRpNFnbITrtFmqeqNkPPo+KemuzbGSY6jvJwCb4v8NsDzrWOLHnQgWl26TkJeWWcUNUeBpq2Mst1/Q==}
arktype@2.1.29:
resolution: {integrity: sha512-jyfKk4xIOzvYNayqnD8ZJQqOwcrTOUbIU4293yrzAjA3O1dWh61j71ArMQ6tS/u4pD7vabSPe7nG3RCyoXW6RQ==}
assertion-error@2.0.1:
resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}
@@ -1677,14 +1677,12 @@ snapshots:
'@img/sharp-linuxmusl-x64': 0.33.5
'@img/sharp-win32-x64': 0.33.5
'@ark/fs@0.53.0': {}
'@ark/fs@0.56.0': {}
'@ark/schema@0.56.0':
dependencies:
'@ark/util': 0.56.0
'@ark/util@0.53.0': {}
'@ark/util@0.56.0': {}
'@borewit/text-codec@0.1.1': {}
@@ -2192,15 +2190,15 @@ snapshots:
arg@5.0.2: {}
arkregex@0.0.4:
arkregex@0.0.5:
dependencies:
'@ark/util': 0.56.0
arktype@2.1.28:
arktype@2.1.29:
dependencies:
'@ark/schema': 0.56.0
'@ark/util': 0.56.0
arkregex: 0.0.4
arkregex: 0.0.5
assertion-error@2.0.1: {}
@@ -2451,7 +2449,7 @@ snapshots:
fast-uri@3.1.0: {}
fastmcp@3.26.8(arktype@2.1.28)(hono@4.11.3):
fastmcp@3.26.8(arktype@2.1.29)(hono@4.11.3):
dependencies:
'@modelcontextprotocol/sdk': 1.25.2(hono@4.11.3)(zod@4.3.5)
'@standard-schema/spec': 1.0.0
@@ -2462,7 +2460,7 @@ snapshots:
strict-event-emitter-types: 2.0.0
undici: 7.16.0
uri-templates: 0.2.0
xsschema: 0.4.0-beta.5(arktype@2.1.28)(zod-to-json-schema@3.25.1(zod@4.3.5))(zod@4.3.5)
xsschema: 0.4.0-beta.5(arktype@2.1.29)(zod-to-json-schema@3.25.1(zod@4.3.5))(zod@4.3.5)
yargs: 18.0.0
zod: 4.3.5
zod-to-json-schema: 3.25.1(zod@4.3.5)
@@ -2974,9 +2972,9 @@ snapshots:
wrappy@1.0.2: {}
xsschema@0.4.0-beta.5(arktype@2.1.28)(zod-to-json-schema@3.25.1(zod@4.3.5))(zod@4.3.5):
xsschema@0.4.0-beta.5(arktype@2.1.29)(zod-to-json-schema@3.25.1(zod@4.3.5))(zod@4.3.5):
optionalDependencies:
arktype: 2.1.28
arktype: 2.1.29
zod: 4.3.5
zod-to-json-schema: 3.25.1(zod@4.3.5)