github-advanced-security[bot] commented on code in PR #52795:
URL: https://github.com/apache/airflow/pull/52795#discussion_r2183085181


##########
airflow-core/src/airflow/ui/src/pages/Iframe.tsx:
##########
@@ -49,12 +49,38 @@
     return <ErrorPage />;
   }
 
+  // Build the href URL with context parameters if the view has a destination
+  let src = iframeView.href;
+
+  if (iframeView.destination !== undefined && iframeView.destination !== 
"nav") {
+    // Check if the href contains placeholders that need to be replaced
+    if (dagId !== undefined) {
+      src = src.replaceAll("{dag_id}", dagId);
+    }
+    if (runId !== undefined) {
+      src = src.replaceAll("{run_id}", runId);
+    }
+    if (taskId !== undefined) {
+      src = src.replaceAll("{task_id}", taskId);
+    }
+  }
+
   return (
-    <Box flexGrow={1} m={-3}>
+    <Box
+      flexGrow={1}
+      height="100%"
+      m={-2} // Compensate for parent padding
+      minHeight={0}
+    >
       <iframe
         sandbox={sandbox}
-        src={iframeView.href}
-        style={{ height: "100%", width: "100%" }}
+        src={src}

Review Comment:
   ## Client-side cross-site scripting
   
   Cross-site scripting vulnerability due to [user-provided value](1).
   
   [Show more 
details](https://github.com/apache/airflow/security/code-scanning/498)



-- 
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]

Reply via email to