fix(core): guard against DOM clobbering in declareExperimentalWebMcpTool · angular/angular@8cf7731 · GitHub
Skip to content

Commit 8cf7731

Browse files
arturovtthePunderWoman
authored andcommitted
fix(core): guard against DOM clobbering in declareExperimentalWebMcpTool
Previously, the modelContext truthiness check could be bypassed via DOM clobbering (e.g. `<form id="modelContext">`), causing a truthy HTMLElement to pass the guard and then throw when `registerTool` was called on it. Replace the truthiness check with a duck-type check that asserts `registerTool` is a function, rejecting both absent and clobbered values.
1 parent 1e79dd3 commit 8cf7731

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/core/src/webmcp/declare_tool.ts

Lines changed: 4 additions & 2 deletions

0 commit comments

Comments
 (0)