T09 · Insecure Skill Coding Practices
- Location
lib/torchsdk/tokens.js:280- Finding
Creator-Controlled Token Metadata URL Enables Server-Side Request Forgery
- Content
View full analysis
{ const controller = new AbortController(); const timer = setTimeout(() => controller.abort(), timeoutMs); const opts = { ...options, signal: controller.signal }; try { if ((0, exports.isIrysUrl)(url)) { return await fetch((0, exports.irysToArweave)(url), opts); } return await fetch(url, opts); } finally { clearTimeout(timer); } }; ``` ### Technical Analysis The `BondingCurve.uri` value is obtained from on-chain token data and can be selected by the token creator. Calling `getToken()` or the Kit's `getFaction()` wrapper causes the runtime to issue a network request to that URI. `fetchWithFallback()` applies a ten-second timeout and rewrites known Irys hostnames, but it does not: - Restrict requests to HTTPS. - Allowlist trusted metadata gateways. - Reject loopback, private, link-local, multicas ...[truncated 1918 chars]- Remediation
View remediation
