T09 · Insecure Skill Coding Practices
- Location
index.js:65- Finding
Non-finite timing values can cause unbounded rapid polling
- Content
View full analysis
- Remediation
View remediation
max) { throw new RangeError(`${name} must be between ${min} and ${max}`); } return candidate; } async function podpoint_watch({ podId, intervalSeconds = 30, timeoutSeconds = 900 }) { const interval = validateFiniteNumber( intervalSeconds, "intervalSeconds", 5, 300, 30 ); const timeout = validateFiniteNumber( timeoutSeconds, "timeoutSeconds", interval, 3600, 900 ); const maximumIterations = Math.ceil(timeout / interval); let iterations = 0; while ( Date.now() - started < timeout * 1000 && iterations++ < maximumIterations ) { // Polling logic } } ``` If accepting numeric strings is required, convert them first and then apply `Number.isFinite()` and the same range checks. Runtime validation should remain in place even when the host claims to enforce the JSON schema. ]]>
