mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-26 15:07:49 +08:00
Compare commits
3 Commits
ce96563147
...
ae273e3525
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae273e3525 | ||
|
|
d8ee7097b1 | ||
|
|
c011389c3f |
@ -204,6 +204,21 @@ public class SipUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Gb28181Sdp parseSDP(String sdpStr) throws SdpParseException {
|
public static Gb28181Sdp parseSDP(String sdpStr) throws SdpParseException {
|
||||||
|
|
||||||
|
// 校验:拦截空内容与注入攻击特征
|
||||||
|
if (sdpStr == null || sdpStr.trim().isEmpty()) {
|
||||||
|
throw new SdpParseException(0, 0, "SDP内容为空");
|
||||||
|
}
|
||||||
|
// 标准SDP每行格式固定为 "x=value",不存在SQL关键字;出现则视为注入攻击
|
||||||
|
String sdpUpper = sdpStr.toUpperCase();
|
||||||
|
if (sdpUpper.contains("' OR '") || sdpUpper.contains("' OR 1") || sdpUpper.contains(" OR 1=1")
|
||||||
|
|| sdpUpper.contains("--") || sdpUpper.contains("/*") || sdpUpper.contains("*/")
|
||||||
|
|| sdpUpper.contains("DROP ") || sdpUpper.contains("INSERT ") || sdpUpper.contains("UPDATE ")
|
||||||
|
|| sdpUpper.contains("DELETE ") || sdpUpper.contains("UNION ") || sdpUpper.contains("SELECT ")) {
|
||||||
|
log.error("[SDP注入攻击] 检测到非法SDP内容,已拒绝解析,内容长度: {}", sdpStr.length());
|
||||||
|
throw new SdpParseException(0, 0, "非法SDP内容");
|
||||||
|
}
|
||||||
|
//校验结束
|
||||||
|
|
||||||
// jainSip不支持y= f=字段, 移除以解析。
|
// jainSip不支持y= f=字段, 移除以解析。
|
||||||
int ssrcIndex = sdpStr.indexOf("y=");
|
int ssrcIndex = sdpStr.indexOf("y=");
|
||||||
|
|||||||
@ -509,7 +509,7 @@ export default {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.$refs.veTree.remove(data, parentNode)
|
this.$refs.veTree.remove(data, parentNode)
|
||||||
for (let item of subData) {
|
for (let item of nextData) {
|
||||||
this.$refs.veTree.append(item, parentNode)
|
this.$refs.veTree.append(item, parentNode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -487,7 +487,7 @@ export default {
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.$refs.veTree.remove(data, parentNode)
|
this.$refs.veTree.remove(data, parentNode)
|
||||||
for (let item of subData) {
|
for (let item of nextData) {
|
||||||
this.$refs.veTree.append(item, parentNode)
|
this.$refs.veTree.append(item, parentNode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user