T09 · Insecure Skill Coding Practices
- Location
scripts/config.py:370- Finding
Arbitrary SOAP Endpoints Enable SSRF and Credential Disclosure
- Content
View full analysis
Vulnerability Details
File Location:
scripts/config.py:370-391
Related Locations:scripts/ps.py:45-49,scripts/adapters/base.py:78-84,scripts/soap.py:70-73
Vulnerability Type: Server-Side Request Forgery and credential exfiltration
Risk Level: HighVulnerable Code
python # scripts/ps.py:45-49 if payload.get("configJson"): config = SupplierConfig.from_dict(payload["configJson"]) elif payload.get("config"): config = SupplierConfig.load(payload["config"])python # scripts/config.py:370-391 url = entry.get("url") version = entry.get("wsVersion") or entry.get("version") if not url: raise ConfigError(f"service '{code}' is missing 'url'") if not version: raise ConfigError(f"service '{code}' is missing 'wsVersion'") key = normalize_service(code) overrides = entry.get("namespaces") or {} if not isinstance(overrides, dict): raise ConfigError( f"service '{code}': 'namespaces' must be an object " "mapping prefix to URI" ) services[key] = ServiceEndpoint( service=key, url=str(url), ws_version=str(version), test_url=entry.get("testUrl") or entry.get("test_url"), status=entry.get("status"), namespaces={str(k): str(v) for k, v in overrides.items()}, )python # scripts/adapters/base.py:78-84 cred_id, password = self.config.require_credentials() prefix = self.AUTH_PREFIX return ( soap.element(f"{prefix}:wsVersion", self.VERSION) + soap.element(f"{prefix}:id", cred_id) + soap.element(f"{prefix}:password", password) )python # scripts/soap.py:70-73 req = urllib.request.Request(url, data=payload, headers=headers, method="POST") try: with urllib.request.urlopen(req, timeout=timeout) as resp:Technical Analysis
The entry point accepts an inline
configJsonobject or an explicit configuration file. ...[truncated 3271 chars]- Remediation
View remediation
Remediation Suggestions
-
Separate trusted and untrusted configuration paths
- Treat inline endpoint configuration and arbitrary config files as privileged administrative inputs.
- For ordinary calls, permit only supplier names resolved through the bundled registry or signed, administrator-approved overrides.
- Do not allow a request payload to select both credential references and arbitrary endpoint hosts.
-
Enforce destination allowlisting
- Bind each supplier identity to a set of approved production and test hosts.
- Verify that every service URL matches the approved supplier-host mapping before resolving credentials.
- Consider storing credential bindings outside caller-controlled configuration.
-
Validate URLs before every request
- Require the
httpsscheme. - Reject embedded user information, malformed ports, fragments, and unsupported schemes.
- Resolve the hostname and reject loopback, private, link-local, multicast, reserved, and unspecified IP ranges for both IPv4 and IPv6.
- Protect against DNS rebinding by connecting to a validated address or revalidating immediately before connection.
- Require the
-
Control redirects
- Disable redirects for SOAP POST operations unless they are required.
- If redirects are supported, validate every redirect destination using the same scheme, hostname, and resolved-address policy.
- Never forward credential-bearing SOAP bodies across origins automatically.
-
Add regression tests
- Verify rejection of
http,file, loopback, RFC1918, IPv6 local, link-local, and metadata destinations. - Verify rejection of redirects to prohibited hosts.
- Verify that credentials are not resolved or inserted until endpoint validation succeeds.
- Verify rejection of
-
