Skip to content

Commit 6db305a

Browse files
CodesMcCabeclaude
andcommitted
fix: anchor regex in apps configured-networks to prevent hostname spoofing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c0b8ddd commit 6db305a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/commands/apps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ export function registerApps(program: Command) {
544544
// Extract RPC network slugs from chain network URLs
545545
const slugs = app.chainNetworks
546546
.map((n) => {
547-
const match = n.rpcUrl?.match(/^https:\/\/([^.]+)\.g\.alchemy\.com/);
547+
const match = n.rpcUrl?.match(/^https:\/\/([^.]+)\.g\.alchemy\.com(?:\/|$)/);
548548
return match ? match[1] : null;
549549
})
550550
.filter((s): s is string => Boolean(s));

0 commit comments

Comments
 (0)