Why it matters
Anyone can make the server download and transform arbitrary URLs, including internal ones.
How to fix it
List the exact image hosts in images.remotePatterns.
Example
The rule's own test fixtures, verbatim: the test suite requires the rule to report the first and not the second.
const config: NextConfig = {
images: { remotePatterns: [{ protocol: "https", hostname: "**" }] },
};
export default config;const config: NextConfig = {
images: { remotePatterns: [{ protocol: "https", hostname: "images.example.com" }] },
};
export default config;What TrustIvan reads
Runs on repository scans of TypeScript source once static analysis is turned on (SAST_RULES and the separately built analyzer image); it is off by default.
Weakness classes and references
Related checks
- Next.js public secret (TypeScript)
TypeScriptSeverity: High
trustivan-typescript-next-public-secret - Next.js image SVG allowed (TypeScript)
TypeScriptSeverity: Medium
trustivan-typescript-next-image-svg-allowed - SQL template literal (TypeScript)
TypeScriptSeverity: Medium
trustivan-typescript-sql-template-literal - JWT decode unverified (TypeScript)
TypeScriptSeverity: High
trustivan-typescript-jwt-decode-unverified - JavaScript URL from request input (TypeScript)
TypeScriptSeverity: High
trustivan-typescript-taint-javascript-url - Token in localStorage (TypeScript)
TypeScriptSeverity: Medium
trustivan-typescript-token-in-localstorage
Terms: SAST (static application security testing), Taint analysis, CWE (Common Weakness Enumeration), OWASP Top 10
All static analysis (SAST) checks · The whole catalogue · How this works in TrustIvan · Documentation