You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CodeRabbit flagged a class of XSS issues across the webapp's legacy JSPs in PR #29. None were introduced by that PR — it only touched these files to migrate them to the new `<t:layout>` shell — but they should be hardened. Grouped by fix pattern.
1. Unescaped `${param.a}` (and similar) in HTML attribute context
`request.getParameter("a")` is rendered straight into a hidden `<input value="...">`. A crafted URL like `?a="><script>alert(1)</script>` injects script. Fix with `<c:out value="..."/>` or `fn:escapeXml(...)`.
`transitclockWebapp/src/main/webapp/reports/apiCalls/index.jsp` — also escapes `agencyId` in many `href` and `agencyName` in text contexts (use `<c:url>`+`<c:param>` for URLs, `<c:out>` for text)
2. Unescaped EL embedded in JavaScript string literals
`'${chartTitle}'` etc. — quotes/backslashes/newlines can break parsing or execute injected JS. Fix by JSON-encoding server-side (e.g. `StringEscapeUtils.escapeEcmaScript`) or rendering into a hidden `
`transitclockWebapp/src/main/webapp/status/serverStatus.jsp` (lines 35–43) — `${rmiError}`, `${monitorResult.type}`, `${monitorResult.message}` should all be `<c:out>`
CodeRabbit flagged a class of XSS issues across the webapp's legacy JSPs in PR #29. None were introduced by that PR — it only touched these files to migrate them to the new `<t:layout>` shell — but they should be hardened. Grouped by fix pattern.
1. Unescaped `${param.a}` (and similar) in HTML attribute context
`request.getParameter("a")` is rendered straight into a hidden `<input value="...">`. A crafted URL like `?a="><script>alert(1)</script>` injects script. Fix with `<c:out value="..."/>` or `fn:escapeXml(...)`.
2. Unescaped EL embedded in JavaScript string literals
`'${chartTitle}'` etc. — quotes/backslashes/newlines can break parsing or execute injected JS. Fix by JSON-encoding server-side (e.g. `StringEscapeUtils.escapeEcmaScript`) or rendering into a hidden `
` from request data
3. Client-side `innerHTML` / popup HTML built from API payloads
If the API ever returns tainted data (or is itself a vector), these become live HTML. Use `textContent` or an `escapeHtml` helper.
4. Status / monitor text rendered raw
Source