mirror of
https://github.com/MengMengCode/CLICD.git
synced 2026-08-08 14:34:49 +08:00
Potential fix for code scanning alert no. 28: DOM text reinterpreted as HTML
Patch Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
@@ -204,9 +204,12 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
rulesContainer.innerHTML = currentRules.map(function(rule, idx) {
|
rulesContainer.innerHTML = currentRules.map(function(rule, idx) {
|
||||||
var dir = (rule.direction || 'in').toLowerCase();
|
var dirRaw = String(rule.direction || 'in').toLowerCase();
|
||||||
var proto = (rule.protocol || 'tcp').toLowerCase();
|
var protoRaw = String(rule.protocol || 'tcp').toLowerCase();
|
||||||
var action = (rule.action || 'ACCEPT').toUpperCase();
|
var actionRaw = String(rule.action || 'ACCEPT').toUpperCase();
|
||||||
|
var dir = (dirRaw === 'in' || dirRaw === 'out') ? dirRaw : 'in';
|
||||||
|
var proto = (protoRaw === 'tcp' || protoRaw === 'udp' || protoRaw === 'icmp' || protoRaw === 'all') ? protoRaw : 'tcp';
|
||||||
|
var action = (actionRaw === 'ACCEPT' || actionRaw === 'DROP' || actionRaw === 'REJECT') ? actionRaw : 'ACCEPT';
|
||||||
var port = escapeHtml(portDisplay(rule.port));
|
var port = escapeHtml(portDisplay(rule.port));
|
||||||
var srcIp = escapeHtml(sourceIpDisplay(rule.source_ip));
|
var srcIp = escapeHtml(sourceIpDisplay(rule.source_ip));
|
||||||
var desc = escapeHtml(rule.description || '');
|
var desc = escapeHtml(rule.description || '');
|
||||||
|
|||||||
Reference in New Issue
Block a user