fix(security): redact IM list credentials and harden MinerU SSRF

Stop returning bot credentials from Viewer-accessible IM channel list
endpoints and validate self-hosted MinerU URLs at config save and fetch time.
This commit is contained in:
wizardchen
2026-07-02 17:50:04 +08:00
committed by lyingbug
parent 929697618f
commit 7099a7e181
7 changed files with 190 additions and 5 deletions
@@ -0,0 +1,20 @@
package docparser
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestValidateMinerUOutboundURL_RejectsLoopback(t *testing.T) {
err := validateMinerUOutboundURL("http://127.0.0.1:8080")
require.Error(t, err)
assert.Contains(t, err.Error(), "SSRF")
}
func TestPingMinerU_RejectsPrivateEndpoint(t *testing.T) {
ok, msg := PingMinerU("http://127.0.0.1:8080")
assert.False(t, ok)
assert.Contains(t, msg, "SSRF")
}