1.8.1 【必須】限定JSONP接口的callback字符集范圍
[a-zA-Z0-9_-]+
1.8.2 【必須】安全的CORS配置
^https://domain\.qq\.com$
// good:使用全等于,校驗(yàn)請(qǐng)求的Origin
if (req.headers.origin === 'https://domain.qq.com') {
res.setHeader('Access-Control-Allow-Origin', req.headers.origin);
res.setHeader('Access-Control-Allow-Credentials', true);
}
關(guān)聯(lián)漏洞:中風(fēng)險(xiǎn) - XSS,中風(fēng)險(xiǎn) - CSRF,中風(fēng)險(xiǎn) - CORS配置不當(dāng)
更多建議: