bbovenzi commented on code in PR #36829:
URL: https://github.com/apache/airflow/pull/36829#discussion_r1463605227
##########
airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts:
##########
@@ -97,7 +99,30 @@ export const parseLogs = (
line.includes(fileSourceFilter)
)
) {
- parsedLines.push(parsedLine);
+ // sanitize the lines to remove any tags that may cause HTML injection
+ const sanitizedLine = sanitizeHtml(parsedLine, {
+ allowedTags: ["a"],
+ allowedAttributes: {
+ a: ["href", "target", "style"],
+ },
+ transformTags: {
+ a: (tagName: any, attribs: { style: string }) => {
Review Comment:
Let's do the types correctly with `yarn add -D @types/sanitize-html`
Then I think it should automatically infer the types for tagName and attribs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]