CSS injection via BB code tag "█████"
The input to a BB code tag is not properly filtered and is converted into a CSS style attribute for a span element. An attacker can use CSS to arbitrarily position elements across the page, enabling UI redressing attacks via forum posts.
- Triaged in under an hour
- Fixed in 4 months
- Disclosed after 4 months
The input to the "█████" BBcode tag is not properly filtered. It gets converted into a CSS style attribute for a span HTML element.
Quotes (") are removed, so there's no way to break out of the CSS style attributed. However it is possible to arbitrarily dress the resulting span element.
To illustrate this here's an example:
███████
This will place a skull on the top of the page (by using position:fixed). I'll attach a screenshot as well.
The power of CSS pretty much allows arbitrary placement of elements across the page. This may also be used in UI redressing attacks.
Impact
Attacker can arbitrarily redress page via forum posts.
Attachments

What the report shows
The target is phpBB, and the feature in question is a BB code tag whose name is redacted in the published report. The researcher found that the input to this tag is not properly filtered: the value is converted into a CSS style attribute on a span HTML element.
The report notes that double quotes (") are removed from the input, so there is no way to break out of the CSS style attribute. Despite that, the researcher found it is possible to arbitrarily dress the resulting span element, that is, to control the CSS declarations applied to it.
The example payload is redacted in the published text, so the exact syntax is not reproduced here. The researcher states that the payload places a skull on the top of the page by using position:fixed, and attaches a screenshot showing the result.

The screenshot shows the skull rendered over the page as a result of the injected CSS.
The report's impact statement is short: an attacker can arbitrarily redress the page via forum posts. The researcher also notes that the power of CSS allows pretty much arbitrary placement of elements across the page, and that this may be used in UI redressing attacks. The report gives no fix details.
Root cause
The report says the input to the tag is not properly filtered and is converted into a CSS style attribute on a span element. Removing double quotes blocks the obvious attribute break-out, but it does not stop the attacker from supplying arbitrary CSS declarations inside the attribute. Sanitising one dangerous character is not the same as validating the whole value against an allowlist of properties and values.
Impact
Because the attacker controls the CSS of an element rendered in other users' browsers, they can position and style content across the page. The report frames this as UI redressing: content can be placed where the attacker wants it, which can mislead users about what they are clicking or reading. The report does not claim script execution, data theft or account takeover, and the quote filtering described in it blocks the straightforward attribute break-out.
How this kind of bug works
CSS injection happens when user input reaches a style context, either a style attribute or the body of a <style> element, without being constrained to safe values. CSS is not a scripting language, but it has enough expressive power to matter: position, z-index, opacity, background, content and similar properties let an attacker move, hide, overlay or replace what a user sees. That is the basis of UI redressing and clickjacking-style tricks, where a victim is shown one thing and interacts with another.
A second, more serious consequence appears when the injected CSS can reference external resources or leak data through selectors and attribute matching, for example by loading a URL conditionally on an input value. Whether that is possible depends on the context and on what the page already contains.
The usual defences are allowlisting: parse the value, accept only a known set of properties and value formats, and reject or strip everything else. Escaping alone is fragile because CSS has many ways to express the same thing, and blocking a single character such as a quote only closes one path into the attribute.
How to test for it
- Identify every place where user input is reflected into a style context: BB code and markup tags, custom BBCode or shortcode handlers, signature and profile fields, theme or template settings, and any feature that lets users pick colours, sizes or alignment.
- Send a benign marker first, such as a distinctive colour or a border, and confirm it appears in the rendered
styleattribute of the response. - Then try to add declarations beyond what the feature intends, for example positioning or layering properties, and observe whether they take effect in the browser.
- Check whether quote characters, semicolons, braces or backslashes are filtered, and whether the filtering can be bypassed with encoding or alternative syntax.
- Test in a context where another user would see the result, such as a forum post viewed by a moderator or another member, since that is what turns a cosmetic issue into a redressing risk.
A positive result is that attacker-chosen CSS declarations are applied to an element rendered to other users. Common false positives are input that is escaped so it displays as text, values that are validated against a strict allowlist, and cases where the styling only affects the attacker's own view.
How it is fixed
Hunting notes
This class of bug tends to hide in features that give users cosmetic control: BBCode and markup extensions, custom profile fields, signature editors, theme customisation, and anything that generates inline styles from stored settings. Recon signals include parameters whose names suggest colour, size, alignment or style, and responses where user input lands inside a style attribute or a <style> block.
What happened, in plain words
phpBB is a popular open-source forum software: the program that runs discussion boards on many websites. Like most forums, it lets people format their posts with BB code, a simple set of tags in square brackets that get turned into HTML, the language browsers use to lay out pages. One of those tags, whose name is redacted in the published report, takes a value from the user and turns it into a CSS style attribute on a span element.
CSS is the language that controls how a page looks: colours, sizes, positions. A style attribute is a small piece of CSS attached directly to one element. A span is a generic inline container used to wrap a piece of text so it can be styled.
The researcher found that the input to this tag is not properly filtered. Whatever the user types ends up inside that style attribute. Double quotes (") are removed from the input, so there is no way to break out of the attribute and start writing HTML of your own. That closes the most obvious door. But it does not stop the attacker from writing arbitrary CSS declarations inside the attribute, and that is enough to arbitrarily dress the resulting span element: to decide exactly how it looks and where it sits.
The example payload is redacted in the published text, so the exact syntax is not reproduced here. The researcher states that the payload places a skull on the top of the page by using position:fixed, and attaches a screenshot showing the result. position:fixed is a CSS rule that pins an element to a spot in the browser window, so it stays there while the page scrolls.

The screenshot shows the skull rendered over the page as a result of the injected CSS.
The report's impact statement is short: an attacker can arbitrarily redress the page via forum posts. In other words, an attacker can use forum posts to make the page look different from what the forum intended. The researcher also notes that the power of CSS allows pretty much arbitrary placement of elements across the page, and that this may be used in UI redressing attacks. UI redressing means arranging what a user sees so that they misread it or click the wrong thing, a close relative of clickjacking.
The report gives no fix details.
In general, how this kind of bug works
CSS injection happens when user input reaches a style context, either a style attribute or the body of a <style> element, without being constrained to safe values. Think of it like a restaurant that lets you write on the order slip: if the kitchen reads whatever you wrote, you can order dishes that were never on the menu. CSS is not a scripting language, but it has enough expressive power to matter: position, z-index, opacity, background, content and similar properties let an attacker move, hide, overlay or replace what a user sees. That is the basis of UI redressing and clickjacking-style tricks, where a victim is shown one thing and interacts with another.
A second, more serious consequence appears when the injected CSS can reference external resources or leak data through selectors and attribute matching, for example by loading a URL conditionally on an input value. Whether that is possible depends on the context and on what the page already contains.
The usual defences are allowlisting: parse the value, accept only a known set of properties and value formats, and reject or strip everything else. Escaping alone is fragile because CSS has many ways to express the same thing, and blocking a single character such as a quote only closes one path into the attribute.
How to test for it
- Identify every place where user input is reflected into a style context: BB code and markup tags, custom BBCode or shortcode handlers, signature and profile fields, theme or template settings, and any feature that lets users pick colours, sizes or alignment. Each of these is a place where the site turns text into styling, so each is a candidate.
- Send a benign marker first, such as a distinctive colour or a border, and confirm it appears in the rendered
styleattribute of the response. A harmless marker proves the input reaches the style context without yet proving anything dangerous. - Then try to add declarations beyond what the feature intends, for example positioning or layering properties, and observe whether they take effect in the browser. This is the step that separates a cosmetic feature from an injection.
- Check whether quote characters, semicolons, braces or backslashes are filtered, and whether the filtering can be bypassed with encoding or alternative syntax. Filtering one character is not the same as validating the whole value.
- Test in a context where another user would see the result, such as a forum post viewed by a moderator or another member, since that is what turns a cosmetic issue into a redressing risk.
A positive result is that attacker-chosen CSS declarations are applied to an element rendered to other users. Common false positives are input that is escaped so it displays as text, values that are validated against a strict allowlist, and cases where the styling only affects the attacker's own view.
How it is fixed
Hunting notes
This class of bug tends to hide in features that give users cosmetic control: BBCode and markup extensions, custom profile fields, signature editors, theme customisation, and anything that generates inline styles from stored settings. Recon signals include parameters whose names suggest colour, size, alignment or style, and responses where user input lands inside a style attribute or a <style> block.
Glossary
- phpBB: open-source forum software used to run discussion boards.
- BB code: a simple set of tags in square brackets that forum users write in posts and the software converts into HTML.
- HTML: the language browsers use to structure a page.
- CSS: the language that controls how a page looks and where things sit.
styleattribute: a piece of CSS attached directly to a single HTML element.span: a generic inline HTML container used to wrap text for styling.- Filtering: removing or blocking certain characters or patterns from user input.
- Attribute break-out: escaping from inside an HTML attribute to write new HTML of your own.
position:fixed: a CSS rule that pins an element to a spot in the browser window, even when the page scrolls.- UI redressing: arranging what a user sees so they misread it or click the wrong thing.
- Clickjacking: tricking a user into clicking something different from what they believe they are clicking.
- CSS injection: getting attacker-controlled CSS into a page's style context.
- Allowlist: a list of values that are permitted, with everything else rejected.
- Escaping: encoding characters so they are treated as text rather than code.
- Server-side validation: checking input on the server, where the user cannot bypass it.
- Defence in depth: applying several independent protections so one failure does not open the door.
- CVSS: a scoring system for rating the severity of a vulnerability.
- False positive: a result that looks like a bug but is not actually exploitable.