Skip to content
XSS Write-up Beginner

Memburu Celah Keamanan di Situs Besar: Eksplorasi CVE-2021–4118

A news site used an outdated jQuery UI Datepicker whose altField option was set from untrusted input, allowing script injection. An attacker could run JavaScript in a victim's browser, potentially stealing session cookies or data.

Abdulrhidayat Follow

Published on medium.com

Pernahkah Anda membayangkan bahwa sebuah situs berita besar yang Anda kunjungi setiap hari mungkin memiliki celah keamanan yang bisa dimanfaatkan oleh pihak tidak bertanggung jawab? Saya baru-baru ini menemukan hal menarik saat melakukan validasi keamanan pada sebuah situs berita ternama di Indonesia.

Abdulrhidayat, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the Datepicker's altField option was passed to a jQuery HTML-insertion sink without sanitisation, so attacker-controlled markup was rendered and executed.

Impact

If exploited, an attacker could steal session cookies and hijack accounts, steal sensitive data, redirect victims to phishing sites, or deface the page; the proof only showed an alert in the author's own browser.

What the attacker needed

Site uses vulnerable jQuery UI; attacker controls altField value; victim opens the datepicker

The fix

Upgrade jQuery UI to version 1.13.0 or later, which treats altField as a CSS selector, and never accept altField from untrusted sources.

How it was found

  1. Identify that the target site uses jQuery UI version 1.10.3.
  2. Open the browser Developer Tools and switch to the Console tab.
  3. Run the proof-of-concept code that creates an input and initialises the datepicker with a crafted altField value.
  4. Open the datepicker and observe the alert pop-up, confirming script execution.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A date-picker widget on the site was configured using a value that could come from a user. The widget treated that value as HTML instead of plain text, so a crafted value could run code in the visitor's browser. This is called cross-site scripting, or XSS.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.