Parse Ethernet Frame HTML formatting fix (#2402)
This commit is contained in:
parent
1baef27e9b
commit
7ca4b3a13d
@ -92,7 +92,7 @@ class ParseEthernetFrame extends Operation {
|
|||||||
const packetData = input.slice(offset);
|
const packetData = input.slice(offset);
|
||||||
|
|
||||||
if (outputFormat === "Packet data") {
|
if (outputFormat === "Packet data") {
|
||||||
return Utils.byteArrayToChars(packetData);
|
return Utils.escapeHtml(Utils.byteArrayToChars(packetData));
|
||||||
} else if (outputFormat === "Packet data (hex)") {
|
} else if (outputFormat === "Packet data (hex)") {
|
||||||
return toHex(packetData);
|
return toHex(packetData);
|
||||||
} else if (outputFormat === "Text output") {
|
} else if (outputFormat === "Text output") {
|
||||||
|
|||||||
@ -41,5 +41,16 @@ TestRegister.addTests([
|
|||||||
"args": ["Hex", "Text output"]
|
"args": ["Hex", "Text output"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Parse Ethernet frame escapes packet data HTML",
|
||||||
|
input: "000000000000ffffffffffff08003c696d67207372633d78206f6e6572726f723d616c6572742831293e3c7363726970743e616c6572742832293c2f7363726970743e",
|
||||||
|
expectedOutput: "<img src=x onerror=alert(1)><script>alert(2)</script>",
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
"op": "Parse Ethernet frame",
|
||||||
|
"args": ["Hex", "Packet data"]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user