fix(security): close remaining GHSA gaps from security triage

Block scheme-prefixed loopback storage checks, validate Notion attachment
URLs, sanitize wiki markdown HTML, and require MCP_SERVER_AUTH_TOKEN for
network MCP transports.
This commit is contained in:
wizardchen
2026-07-02 14:58:19 +08:00
committed by lyingbug
parent f23c674bad
commit cd65665894
9 changed files with 158 additions and 13 deletions
@@ -347,3 +347,17 @@ func TestClientQueryDatabaseAll(t *testing.T) {
// Ensure time import is used (referenced by fakeNotion indirectly via time.Time in types).
var _ = time.Now
func TestDownloadFile_RejectsLoopbackURL(t *testing.T) {
secutils.ResetSSRFWhitelistForTest()
t.Cleanup(secutils.ResetSSRFWhitelistForTest)
client, err := newClient("test-token", "https://api.notion.com")
if err != nil {
t.Fatalf("newClient: %v", err)
}
_, err = client.DownloadFile(context.Background(), "http://127.0.0.1/secret")
if err == nil {
t.Fatal("expected loopback attachment URL to be rejected")
}
}