Skip to content

Security: Reflected XSS in HTML error page rendering#2035

Open
tuanaiseo wants to merge 1 commit into
yuzutech:mainfrom
tuanaiseo:contribai/fix/security/reflected-xss-in-html-error-page-renderi
Open

Security: Reflected XSS in HTML error page rendering#2035
tuanaiseo wants to merge 1 commit into
yuzutech:mainfrom
tuanaiseo:contribai/fix/security/reflected-xss-in-html-error-page-renderi

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

The error page template inserts {errorMessage} and {stackTrace} directly into HTML without escaping. Error messages can include untrusted content (for example, external tool stderr/stdout propagated through exceptions), which could execute script in a browser viewing the error page.

Severity: high
File: server/src/main/resources/web/error.html

Solution

HTML-escape all dynamic values before template substitution (error message, stack trace, title, logo placeholders if dynamic). Prefer server-side templating with automatic escaping and only allow explicit safe HTML for tightly controlled fields.

Changes

  • server/src/main/resources/web/error.html (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The error page template inserts `{errorMessage}` and `{stackTrace}` directly into HTML without escaping. Error messages can include untrusted content (for example, external tool stderr/stdout propagated through exceptions), which could execute script in a browser viewing the error page.

Affected files: error.html

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
@ggrossetie
Copy link
Copy Markdown
Member

The new variables are not defined. Is this an automated AI pull request?

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