Skip to content

Conversation

@springfall2008
Copy link
Owner

Copilot AI review requested due to automatic review settings January 22, 2026 08:21
@springfall2008 springfall2008 merged commit 501f36a into main Jan 22, 2026
5 checks passed
@springfall2008 springfall2008 deleted the fixes8 branch January 22, 2026 08:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the web dashboard entity-attributes rendering to better handle very large attribute values and avoid breaking the UI. It introduces truncation for display and a larger, escaped version for tooltips.

Changes:

  • Replace the previous hard cutoff of large attribute values (> 1024 chars) with a scheme that shows a truncated 128-character preview plus a tooltip.
  • Limit tooltip content to 16k characters and escape HTML entities in the tooltip string for safer rendering.

Comment on lines +198 to +205
full_value = str(value)[:16384] # Limit to 16k
full_value = full_value.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace('"', "&quot;").replace("'", "&#39;")
if len(str(value)) > 128:
display_value = str(value)[:128] + " ... "
# Escape HTML entities for tooltip
text += '<tr><td>{}</td><td title="{}">{}</td></tr>'.format(key, full_value, display_value)
else:
text += "<tr><td>{}</td><td>{}</td></tr>".format(key, value)
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new logic escapes full_value for the tooltip but still interpolates display_value and the non-truncated value directly into the <td> contents without HTML escaping. If an attribute value contains <, >, or other HTML, this will be rendered as raw markup and could allow HTML/JS injection in the web UI. Consider HTML-escaping both the visible cell content (for both the truncated and non-truncated branches) and the tooltip consistently (for example using html_module.escape as elsewhere in this file) instead of only partially escaping the tooltip string.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants