|
2 | 2 | // @name CCW-Code-Injection-Risk-Warning |
3 | 3 | // @description CCW代码注入风险警告,让你的账号更安全。 |
4 | 4 | // @author bddjr |
5 | | -// @version 20260510-1243 |
| 5 | +// @version 20260523-1242 |
6 | 6 | // @match https://www.ccw.site/* |
7 | 7 | // @match https://learn.ccw.site/* |
8 | 8 | // @match https://m.ccw.site/* |
@@ -124,51 +124,11 @@ if (location.hostname == 'm.ccw.site') { |
124 | 124 | if (acceptLoadExt !== true && out?.targets?.[0]?.blocks) { |
125 | 125 | if (acceptLoadExt === null) { |
126 | 126 | const { targets, extensions, extensionURLs } = out |
127 | | - const hasCCWData = checkHasExt(extensions, "CCWData") |
128 | | - const hasWitCatJSSandBox = checkHasExt(extensions, "WitCatJSSandBox") |
129 | 127 | let hasCustomExt = false |
130 | 128 | let needWarn = false |
131 | 129 | const msg = ['【脚本 CCW代码注入风险警告】'] |
132 | | - // CCWData |
133 | | - if (hasCCWData) { |
134 | | - // needWarn = true |
135 | | - if (hasWitCatJSSandBox) { |
136 | | - needWarn = true |
137 | | - msg.push('漏洞链警告!作品可能会使用“白猫的JS沙箱”扩展调用“Gandi云数据”扩展的代码注入漏洞积木!') |
138 | | - } |
139 | | - // 检测代码注入漏洞积木 |
140 | | - let hasCodeInjectionBlock = false |
141 | | - const codeInjectionBlocksCount = { |
142 | | - CCWData_getValueInJSON: 0, |
143 | | - CCWData_setValueInJSON: 0 |
144 | | - } |
145 | | - for (const target of targets) { |
146 | | - const { blocks } = target |
147 | | - for (const id in blocks) { |
148 | | - const block = blocks[id] |
149 | | - const { opcode } = block |
150 | | - if (codeInjectionBlocksCount.hasOwnProperty(opcode)) { |
151 | | - hasCodeInjectionBlock = true |
152 | | - codeInjectionBlocksCount[opcode]++ |
153 | | - } |
154 | | - } |
155 | | - } |
156 | | - // 生成警告消息 |
157 | | - const thisMsgPrefix = '作品试图加载“Gandi云数据”扩展,' |
158 | | - if (hasCodeInjectionBlock) { |
159 | | - needWarn = true |
160 | | - const thisMsg = [thisMsgPrefix + '并使用以下代码注入漏洞积木:'] |
161 | | - for (const opcode in codeInjectionBlocksCount) { |
162 | | - const count = codeInjectionBlocksCount[opcode] |
163 | | - if (count) thisMsg.push(JSON.stringify(opcode) + ' × ' + count + ' 块') |
164 | | - } |
165 | | - msg.push(thisMsg.join('\n')) |
166 | | - } else { |
167 | | - // msg.push(thisMsgPrefix + '但未检测到代码注入漏洞积木。') |
168 | | - } |
169 | | - } |
170 | 130 | // 自制扩展 |
171 | | - if (extensionURLs instanceof Object) { |
| 131 | + if (typeof extensionURLs == 'object' && extensionURLs) { |
172 | 132 | const customExtDisplayArray = ['作品试图加载自制扩展:'] |
173 | 133 | for (const key in extensionURLs) { |
174 | 134 | const url = new URL(extensionURLs[key], location).href; |
|
0 commit comments