@miller-tech/uap 1.148.15 → 1.148.17
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/dist/.tsbuildinfo +1 -1
- package/dist/cli/deliver.d.ts.map +1 -1
- package/dist/cli/deliver.js +17 -0
- package/dist/cli/deliver.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +24 -0
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/verify.d.ts.map +1 -1
- package/dist/cli/verify.js +14 -7
- package/dist/cli/verify.js.map +1 -1
- package/dist/delivery/execution-gate.d.ts +17 -3
- package/dist/delivery/execution-gate.d.ts.map +1 -1
- package/dist/delivery/execution-gate.js +69 -23
- package/dist/delivery/execution-gate.js.map +1 -1
- package/dist/delivery/project-preflight.d.ts +38 -0
- package/dist/delivery/project-preflight.d.ts.map +1 -0
- package/dist/delivery/project-preflight.js +79 -0
- package/dist/delivery/project-preflight.js.map +1 -0
- package/package.json +1 -1
- package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
- package/src/policies/enforcers/delivery_enforcement.py +6 -1
- package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-312.pyc +0 -0
- package/tools/agents/tests/test_delivery_enforcement_web_and_bash.py +21 -0
|
@@ -221,8 +221,13 @@ _BASH_WRITE_RE = re.compile(
|
|
|
221
221
|
re.IGNORECASE,
|
|
222
222
|
)
|
|
223
223
|
# A browser LAUNCH (not a lookup: `which firefox` / `command -v chrome` are fine).
|
|
224
|
+
# Match the browser by BASENAME anywhere a command word can start, so an absolute
|
|
225
|
+
# or relative path reaches it too. Anchoring on "name right after the separator"
|
|
226
|
+
# let `nohup /home/u/.cloakbrowser/chromium-146/chrome file:///x.html &` walk
|
|
227
|
+
# straight through the gate — the invocation the model actually reaches for.
|
|
224
228
|
_BROWSER_RE = re.compile(
|
|
225
|
-
r"(?:^|[;&|]
|
|
229
|
+
r"(?:^|[;&|(]|\|\||&&|\bnohup\b|\bsetsid\b|\bexec\b|\bxargs\b|\benv\b|\bnice\b|\btimeout\b|`|\$\()"
|
|
230
|
+
r"\s*(?:[\w./~+-]*/)?(" + "|".join(BROWSER_BINS) + r")\b",
|
|
226
231
|
re.IGNORECASE,
|
|
227
232
|
)
|
|
228
233
|
_LOOKUP_RE = re.compile(r"^\s*(?:which|command\s+-v|type|whereis)\b", re.IGNORECASE)
|
|
Binary file
|
|
@@ -56,6 +56,27 @@ class BashGateTest(unittest.TestCase):
|
|
|
56
56
|
code, _ = run("Bash", {"command": "nohup firefox /tmp/a.html &"})
|
|
57
57
|
self.assertEqual(code, 2)
|
|
58
58
|
|
|
59
|
+
def test_browser_by_ABSOLUTE_PATH_is_blocked(self):
|
|
60
|
+
# The bypass the model actually found: the old regex wanted the browser
|
|
61
|
+
# NAME immediately after the separator, so any path to the binary walked
|
|
62
|
+
# straight through the gate.
|
|
63
|
+
for cmd in (
|
|
64
|
+
"nohup /home/u/.cloakbrowser/chromium-146.0.7213.0/chrome file:///tmp/x.html &",
|
|
65
|
+
"/usr/bin/google-chrome-stable /tmp/a.html",
|
|
66
|
+
"setsid ./bin/firefox /tmp/a.html",
|
|
67
|
+
"cd /tmp && /opt/google/chrome/chrome index.html",
|
|
68
|
+
"(chromium /tmp/a.html)",
|
|
69
|
+
):
|
|
70
|
+
code, out = run("Bash", {"command": cmd})
|
|
71
|
+
self.assertEqual(code, 2, f"{cmd} must be BLOCKED — got {out}")
|
|
72
|
+
self.assertIn("uap verify", out)
|
|
73
|
+
|
|
74
|
+
def test_browser_substring_is_not_blocked(self):
|
|
75
|
+
# `open` is a browser bin on macOS; don't let it swallow openssl/opencode.
|
|
76
|
+
for cmd in ("openssl version", "opencode run --help", "npm run chromedriver:check"):
|
|
77
|
+
code, out = run("Bash", {"command": cmd})
|
|
78
|
+
self.assertEqual(code, 0, f"{cmd} must NOT be blocked — got {out}")
|
|
79
|
+
|
|
59
80
|
def test_browser_LOOKUP_is_not_blocked(self):
|
|
60
81
|
# `which firefox` is a capability probe, not a launch — must not false-block.
|
|
61
82
|
code, _ = run("Bash", {"command": "which firefox chromium 2>/dev/null"})
|