From abf9342799c4fc3e0066bc39cda0c880bb7d8a82 Mon Sep 17 00:00:00 2001
From: Noah Ingwers <98993329+noah-ing@users.noreply.github.com>
Date: Thu, 20 Aug 2026 16:44:08 -0500
Subject: [PATCH] Harden tool dispatch against inherited properties
---
edge/test/worker.test.mjs | 6 +++++-
src/tools.mjs | 3 ++-
test/tools.test.mjs | 10 ++++++++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/edge/test/worker.test.mjs b/edge/test/worker.test.mjs
index 19d4899..c0565df 100644
--- a/edge/test/worker.test.mjs
+++ b/edge/test/worker.test.mjs
@@ -210,7 +210,11 @@ test("root storefront serves the honest Guard founding offer for exact GET and H
assert.match(html, /No payment is due with this application/);
assert.match(html, /not posted publicly/);
assert.doesNotMatch(html, /email notification|we(?:'|’)ll notify/i);
- const inlineScript = html.match(/", scriptStart);
+ const inlineScript = scriptStart === -1 || scriptEnd === -1
+ ? undefined
+ : html.slice(scriptStart + "