Skip to content
XSS Write-up Intermediate

Обход Bitrix WAF

Bitrix's built-in WAF, which blocks reflected XSS by comparing user input with the page body, strips null bytes from parameter values before comparison. An attacker could bypass the filter by placing a null byte before the closing quote in a parameter that lands inside a script tag, allowing script execution.

Рамазан Рамазанов Follow

Published on deteact.ru

Бывает, что при проведении XSS отражённого типа параметры попадают прямо в тело тега script. Обычно это означает, что эксплуатация тривиальна: не помешает кодирование скобок, не помешают многие фаерволы, в том числе ныне почивший Chrome XSS Auditor. Но в CMS Bitrix на этот случай есть свой встроенный проактивный…

DeteAct, on deteact.ru

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

What the attacker needed

Bitrix with WAF module enabled; A parameter reflected inside a script tag; Victim clicks a crafted link

The fix

The WAF should be fixed by removing the null-byte stripping from addVariable and instead rejecting or handling null bytes explicitly.

How it was found

  1. Set up a test Bitrix application with the WAF module enabled and a page that reflects a GET parameter inside a script tag.
  2. Send a payload with a closing quote and a function call; the WAF replaces the whole script with a stub.
  3. Insert a null byte before the closing quote in the parameter.
  4. The WAF passes the code and the script executes.

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 website took a value from the URL and placed it inside a JavaScript block on the page. Bitrix's firewall tried to stop injected code by checking whether the URL value appeared in the page, but it removed a special invisible character (a null byte) from the URL value before checking. Because the page still contained that character, the check failed to match and the injected code ran.

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.