fix(web): web_fetch uses SafeHTTPClient — pins validated IP (S2)

This commit is contained in:
sausheong committed 2026-06-13 11:20:12 +08:00
1 parent 1e00916a82
commit d7777f7c89
2 files changed
+17 -13

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
package web
import (
"context"
"testing"
"github.com/stretchr/testify/require"
)
func TestWebFetch_BlocksPrivateHost(t *testing.T) {
tool := &WebFetchTool{}
res, err := tool.Execute(context.Background(),
[]byte(`{"url":"http://169.254.169.254/latest/meta-data/"}`))
require.NoError(t, err)
require.NotEmpty(t, res.Error, "private metadata IP must be rejected")
}