Skip to content

Commit 617adab

Browse files
committed
remove CCWData
1 parent 8bc6b8f commit 617adab

2 files changed

Lines changed: 2 additions & 43 deletions

File tree

CCW-Code-Injection-Risk-Warning.user.js

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name CCW-Code-Injection-Risk-Warning
33
// @description CCW代码注入风险警告,让你的账号更安全。
44
// @author bddjr
5-
// @version 20260510-1243
5+
// @version 20260523-1242
66
// @match https://www.ccw.site/*
77
// @match https://learn.ccw.site/*
88
// @match https://m.ccw.site/*
@@ -124,51 +124,11 @@ if (location.hostname == 'm.ccw.site') {
124124
if (acceptLoadExt !== true && out?.targets?.[0]?.blocks) {
125125
if (acceptLoadExt === null) {
126126
const { targets, extensions, extensionURLs } = out
127-
const hasCCWData = checkHasExt(extensions, "CCWData")
128-
const hasWitCatJSSandBox = checkHasExt(extensions, "WitCatJSSandBox")
129127
let hasCustomExt = false
130128
let needWarn = false
131129
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-
}
170130
// 自制扩展
171-
if (extensionURLs instanceof Object) {
131+
if (typeof extensionURLs == 'object' && extensionURLs) {
172132
const customExtDisplayArray = ['作品试图加载自制扩展:']
173133
for (const key in extensionURLs) {
174134
const url = new URL(extensionURLs[key], location).href;

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ CCW代码注入风险警告,让你的账号更安全。
44
https://bddjr.github.io/CCW-Code-Injection-Risk-Warning/CCW-Code-Injection-Risk-Warning.user.js
55

66
该脚本支持检测并拦截以下攻击:
7-
- 基于作品使用 “Gandi 云数据” 扩展的代码注入漏洞攻击
87
- 基于作品加载第三方扩展的代码注入漏洞攻击
98
- 基于创作者学院的文章里嵌入 iframe 的代码注入漏洞攻击
109

0 commit comments

Comments
 (0)