Issues

Select view

Select search mode

 
23 of 23

Cross-site Scripting (XSS) in server.go error response

Done

Description

snyk.io reports that server.go

https://github.com/folio-org/mod-reporting/blob/v1.3.0/src/server.go#L161

https://github.com/folio-org/mod-reporting/blob/v1.3.0/src/server.go#L176

creates an HTTP error response that may contain external content. An attacker may embed malicious HTML code into the external content resulting in a Cross-site Scripting (XSS) attack (provided that the response is directly displayed in the browser/front-end without masking of HTML entities).

Some options for a potential fix:

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Checklist

hide

Details

Assignee

Reporter

Priority

Development Team

Thor

Fix versions

Release

Sunflower (R1 2025) Bug Fix

RCA Group

TBD

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created last week
Updated 20 hours ago
Resolved 5 days ago

Activity

Show:

Julian Ladisch 20 hours ago

Thank you!

func Error changes the Content-Type to text, server.go initially had set it to html: https://github.com/folio-org/mod-reporting/blob/v1.3.0/src/server.go#L106

Mike Taylor 5 days ago

It seems to me that func Error(w ResponseWriter, error string, code int) does not escape the string, so html.EscapeString would be needed in any case — is that your understanding, too?

Mike Taylor 5 days ago

Nicely spotted! Thanks, I’ll take this.

TestRail: Cases
TestRail: Runs

Flag notifications