mirror of
https://github.com/Silentely/eSIM-Tools.git
synced 2026-09-03 06:24:20 +08:00
修复 GitHub 代码扫描发现的所有安全问题,涵盖 20 个文件、76 个告警: - Actions 工作流:添加 Fork 仓库限制、来源验证、persist-credentials: false、移除 npm cache - 明文存储:localStorage 迁移到 secureStorage (sessionStorage + TTL) - 日志注入:新增 sanitizeLog() 过滤换行符,覆盖全部 console.log 调用 - SSRF:新增 isAllowedTarget() 域名白名单校验 - SRI 完整性:为 Bootstrap/Font Awesome/GTM 添加 integrity + crossorigin - XSS 防护:错误消息 HTML 转义、Service Worker origin 验证 - URL 清洗:hostname.includes() 替换为精确域名匹配 - HTML 过滤:扩展标签黑名单、添加事件属性过滤 - 限流:全局引入 createRateLimiter (200 req/min/IP)