--- note type: - note - microlise - security date: 2026-06-03 done: true --- # Links: - [[Cross Site Scripting (XSS)]] # Metadata - Name Understanding Session XSS - Overview Pages 33–34 document an informational “Session stored XSS” finding on the TMC Schedule Execution Board. The issue is real (unescaped user input in a JavaScript context) but impact is limited because only the submitting user’s session is affected—classic self-XSS, not cross-user attack. ## Todos - \[X\] review-finding Read pages 33–34 and map finding to SaveSearchCriteriaToSession + ScheduleExecutionBoard.aspx flow - \[X\] locate-source Open TMC Web Portal repo and find session save + inline script render for date/orderID/time - \[ \] remediate-encode Apply HttpUtility.JavaScriptStringEncode to all session values in SetupControls() (\~1849-1879) - \[ \] remediate-validate Add server-side validation in SaveSearchCriteriaToSession before writing SEBSessionState - \[ \] remediate-retest Retest with direct POST payload + normal UI search flow on ScheduleExecutionBoard # Understanding the Session Stored XSS Finding (Pages 33–34) ## Where this sits in the report The [Microlise TMC PO WA April 2026 v1.0.pdf](d:/_dev/_misc/Pentest-04-26/Microlise%20TMC%20PO%20WA%20April%202026%20v1.0.pdf) lists **14 findings** total. Pages 33–34 ([33-34.pdf](d:/_dev/_misc/Pentest-04-26/33-34.pdf)) are the last technical finding before “END OF DOCUMENT”: | Field | Value | | ----------- | ------------------------------------------------------------------------------------------- | | Title | **Session stored XSS** | | Severity | **Informational** (lowest tier; 4 informational findings in the report) | | Status | Open | | CWE | [CWE-79](https://cwe.mitre.org/data/definitions/79.html) — Improper Neutralization of Input | | Environment | `cert.microlise.com` (cert/UAT), path prefix `/PENTEST/TMCWebPortal/` | Higher-severity items in the same report (SQLi, IDOR, BFLA, etc.) are separate; this finding is documented as **technically valid but low business risk**. ----- ## What XSS is (general) **Cross-Site Scripting (XSS)** means untrusted data ends up in a web page in a way the **browser treats as executable JavaScript**, instead of inert text. The name “cross-site” is historical: classic attacks trick a **victim** into loading a page on **your** app so script runs in **your** origin (stealing session cookies, performing actions as the user, etc.). Common types: | Type | Persistence | Typical delivery | | ------------- | ------------------------------------- | -------------------------------- | | **Reflected** | Not stored; one-off response | Malicious link/query param | | **Stored** | Saved server-side (DB, file, session) | Victim loads a normal page later | | **DOM-based** | Client-side only | Unsafe innerHTML, eval, etc. | **Defense in depth:** validate input on the server (whitelist formats), and **encode output** for the exact context (HTML, attribute, JavaScript string, URL). ----- ## What happened in *this* finding (TMC context) ### Affected surface (source located) | Role | Path | | --------------------------- | ---------------------------------------------------------------------------------------------------------- | | Page + inline JS | [ScheduleExecutionBoard.aspx](d:/_dev/WebPortal/src/code/AmberWebUI/SEB/ScheduleExecutionBoard.aspx) | | WebMethod + page properties | [ScheduleExecutionBoard.aspx.cs](d:/_dev/WebPortal/src/code/AmberWebUI/SEB/ScheduleExecutionBoard.aspx.cs) | | Session storage | [SEBSessionState.cs](d:/_dev/WebPortal/src/code/AmberWebUI/SEB/SEBSessionState.cs) | - **Endpoint:** ASP.NET `[WebMethod]` `SaveSearchCriteriaToSession` on `ScheduleExecutionBoard.aspx` - **Parameters:** JSON fields `date`, `orderID`, `time` (also `searchID`, `hours`, `quickSearch` in the same flow) - **Host (pentest):** `cert.microlise.com`, path `/PENTEST/TMCWebPortal/SEB/...` ### Attack flow (as tested) ``` mermaid flowchart LR subgraph submit [Step1_Submit] A[Tester sends POST directly] B[SaveSearchCriteriaToSession] C[Values stored in server session] end subgraph render [Step2_Render] D[User loads ScheduleExecutionBoard.aspx] E[Server embeds session values in script block] F[Browser executes unescaped JS] end A --> B --> C C --> D --> E --> F ``` 1. **Save:** User (or tester) POSTs JSON to `SaveSearchCriteriaToSession`. The app saves search criteria into the **server-side session**. 2. **Render:** On the next load of `ScheduleExecutionBoard.aspx`, those values are written into the HTML **inside a `