Visitar URL original
[SPARK-54624][UI][3.5] Ensure user name in historypage get escaped · apache/spark@d1790ee · GitHub
Skip to content

Commit d1790ee

Browse files
committed
[SPARK-54624][UI][3.5] Ensure user name in historypage get escaped
### What changes were proposed in this pull request? This PR backports #53364 to `branch-3.5`. This PR aims to escape user name displayed in historypage. ### Why are the changes needed? Similar to the issue resolved in #52851, user name should also get escaped because arbitrary user name can be set through the env var `SPARK_USER`. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? User name displayed in historypage is escaped even if the name is like `<script>alert('XSS')</script>` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #53425 from sarutak/fix-username-xss-3.5. Authored-by: Kousuke Saruta <sarutak@amazon.co.jp> Signed-off-by: Kousuke Saruta <sarutak@apache.org>
1 parent e348c29 commit d1790ee

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎core/src/main/resources/org/apache/spark/ui/static/historypage.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ $(document).ready(function() {
208208
data: 'duration',
209209
render: (id, type, row) => `<span title="${row.durationMillisec}">${row.duration}</span>`
210210
},
211-
{name: 'user', data: 'sparkUser' },
211+
{
212+
name: 'user',
213+
data: 'sparkUser',
214+
render: (name) => escapeHtml(name)
215+
},
212216
{name: 'lastUpdated', data: 'lastUpdated' },
213217
{
214218
name: 'eventLog',

0 commit comments

Comments
 (0)