T09 · Insecure Skill Coding Practices
- Location
scripts/validator.js:10- Finding
Insufficient URL Validation Permits Unintended Network Access
- Content
View full analysis
!document.URL.includes('login') && document.readyState === 'complete', { timeout: timeout / 2 } ); ``` ### Technical Analysis The URL allowlist is implemented by searching the entire URL string for `mp.weixin.qq.com` and `/s/`. These checks do not establish that the parsed destination hostname is actually `mp.weixin.qq.com`. An attacker can place the expected domain text in the URL user-information component while selecting another host as the actual destination. For example: ```text http://mp.weixin.qq.com@127.0.0.1/s/test ``` This value is syntactically valid, contains both required substrings, and therefore passes `validateUrlFormat()` and `validateWeChatUrl()`. However, its actual hostname is `127.0.0.1`. The implementation also allows Playwright to follow redirects without validating each redirect target or the final hostname. Consequently, even an initially valid WeChat URL could redirect the browser to an unintended destination. Because the destination is opened in a full browser, the loaded page can execute JavaScript and generate additional network requests. No request inte ...[truncated 1783 chars]- Remediation
View remediation
