Authenticated path traversal to Stored XSS and Denial-of-Service
The emoji import feature in phpBB's admin control panel passes an unsanitised 'pak' parameter directly to PHP's file() function, allowing an authenticated admin to read special files such as /proc/self/fd/1 and hang the request, causing a denial of service. The SMILEY_IMG field from imported emoji packs is also not escaped, so a crafted pack can store an XSS payload that fires for anyone viewing pages where the emoji appears.
- Triaged in 25 hours
- Fixed in 38 days
- Disclosed after 42 days
Denial-of-Service
The vulnerabiity lies on the line 552 of acp_icons.phpfile, when importing emoji from a file we can tell phpBB which file to import from via the paramter pak, without any sanitization, the pak paramter gets passed dirrectly to file the file function, which attemp to read the content of the file to an array.

Because of the check, reading files like /etc/passwd would not be possible, but if we try to read files like /proc/self/fd/1, the request will hang, a TCP connection will be kept open, the will bring lots of burden to the server. More over, in the case when phpBB is behind a proxy, which may process concurrent request one by one, in this case, if the previous request has not finished, the the rest of requests will have to wait for it to timeout, causing a Denial-of-Service
In the progress of testing, i use the default HTTP server of PHP, which simulate exactly what a one-by-one request processing proxy would do. Request:
POST /adm/index.php?i=acp_icons&mode=smilies¤t=delete HTTP/1.1
Host: 127.0.0.1:8082
sec-ch-ua: "Chromium";v="113", "Not-A.Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.127 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Content-Type: application/x-www-form-urlencoded
Referer: http://127.0.0.1:8082/adm/index.php?i=acp_icons&mode=smilies
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: csrftoken=Ky6rB5uThxl3PwYd6EScmT9WXYiH6rGe; sessionid=hmrhwwo5hj5abu4kqgln2let1x9zudbr; phpbb3_83bmg_u=2; phpbb3_83bmg_k=zalvonnyh1lr16og; phpbb3_83bmg_sid=3ba797a8668f6db1639ac6939d91f96e
Connection: close
Content-Length: 137
action=import&pak=../../../../../../../../../proc/self/fd/1&form_token=b2655d5f0c9edb201328b799a61777b26cef16a5&creation_time=1694960302
Result timed-out and no response received:

This vulnerability can also help an authenticated attacker know which file exist on server by observe the response message, if the file is not found, the error from $user->lang['PAK_FILE_NOT_READABLE'] would trigger and result in different message than $user->lang['WRONG_PAK_TYPE'](when the file exist but has invalid format)
Stored XSS
When testing the emoji import, i also observe that the SMILEY_IMG isn't sanitized or escaped

So we can import a malicious emoji file containing the XSS payload, everyone who access the sites (posting section, comment section, admin section, ...) that emoji presents will trigger the XSS payload, leading to web defacement, cookie stealing, malware attack, ...
'icon_e_biggrin.gif', '15', '17', '1', 'Very Happy', ':D',
'icon_e_biggrin.gif', '15', '17', '1', 'Very Happy', ':-D',
'icon_e_biggrin.gif', '15', '17', '1', 'Very Happy', ':grin:',
'icon_e_smile.gif', '15', '17', '1', 'Smile', ':)',
'icon_e_smile.gif', '15', '17', '1', 'Smile', ':-)',
'icon_e_smile.gif', '15', '17', '1', 'Smile', ':smile:',
'icon_e_wink.gif', '15', '17', '1', 'Wink', ';)',
'icon_e_wink.gif', '15', '17', '1', 'Wink', ';-)',
'icon_e_wink.gif', '15', '17', '1', 'Wink', ':wink:',
'icon_e_sad.gif', '15', '17', '1', 'Sad', ':(',
'icon_e_sad.gif', '15', '17', '1', 'Sad', ':-(',
'icon_e_sad.gif', '15', '17', '1', 'Sad', ':sad:',
'icon_e_surprised.gif', '15', '17', '1', 'Surprised', ':o',
'icon_e_surprised.gif', '15', '17', '1', 'Surprised', ':-o',
'icon_e_surprised.gif', '15', '17', '1', 'Surprised', ':eek:',
'icon_eek.gif', '15', '17', '1', 'Shocked', ':shock:',
'icon_e_confused.gif', '15', '17', '1', 'Confused', ':?',
'icon_e_confused.gif', '15', '17', '1', 'Confused', ':-?',
'icon_e_confused.gif', '15', '17', '1', 'Confused', ':???:',
'"onmouseover=alert() ><script>alert()</script>', '17', '18', '1', 'POC', ':POC:',
The problem is, if the attacker has no file access permission, how would he be able to import emoji from files? In here, i abused the function of PHP that it will create an tmp file in /tmp and has an file descriptor pointing at it (in my case was /proc/self/fd/10) when php process an uploading, then we will spam a lot of upload attachment request and in the same time, use race condition to import the file before it's deleted. Below i record a short video, spaming the upload request and use a small php file which emulate the behavior of the import function for demonstration purpose, i would be quite the same with the real function but if i turn on to many tab for race condition and also the recorder, i laptop will explose...
The final result:

Impact
The impact for both DoS and XSS has been mentioned above
Mitigation
I suggest HTML entity encoding data from emoji before show to client, limiting the folder of which user can import the emoji from.
Context
phpBB is a widely deployed forum package. Its administration control panel (ACP) includes a smilies and icons editor, reachable at adm/index.php with i=acp_icons&mode=smilies. One of the features of that page is importing a set of emoji or smilies from a "pak" file: the administrator supplies a file name, phpBB reads it, parses the smiley definitions and stores them so they can be used in posts, comments and the admin interface.
The report describes two issues found in that import feature: an authenticated path traversal that leads to a denial of service (and to a limited file existence oracle), and a stored cross-site scripting issue in the imported smiley image field. Both require an authenticated session, since the feature lives in the ACP.
Setup
The researcher tested against a local phpBB instance. The HTTP requests in the report are sent to [redacted]:8082, and the session cookies in them are phpBB's own (phpbb3_83bmg_u, phpbb3_83bmg_k, phpbb3_83bmg_sid) plus a csrftoken and sessionid pair. The browser used for the captured requests identifies itself as Chrome 113 on Windows.
For the denial-of-service test the researcher deliberately used PHP's built-in HTTP server, because it processes requests one at a time, which reproduces the behaviour of a proxy that serialises concurrent requests. For the XSS part, the researcher used a small PHP file that emulates the behaviour of the import function, for demonstration purposes, together with a screen recorder.
No version numbers are given in the report.
Finding it
The starting point is line 552 of acp_icons.php. When importing emoji from a file, phpBB lets the client choose which file to import through the pak parameter. That parameter is passed directly to the file function, which reads the file's contents into an array. There is no sanitisation of the value before it reaches that call.

A check in the code prevents reading arbitrary files such as /etc/passwd, so the obvious file disclosure is not available. But the check does not prevent pointing pak at special files. Reading something like /proc/self/fd/1 never returns: the request hangs and the TCP connection stays open, which places load on the server. If phpBB sits behind a proxy that handles concurrent requests one by one, every subsequent request has to wait for the hanging one to time out, which turns the hang into a denial of service.
While testing the import, the researcher also noticed that the SMILEY_IMG value is neither sanitised nor escaped when it is rendered.
Exploitation
Step 1: hang the request with a path traversal in pak
The import is triggered with a POST to the ACP smilies page. The pak parameter carries a traversal sequence ending at a file descriptor of the PHP process:
POST /adm/index.php?i=acp_icons&mode=smilies¤t=delete HTTP/1.1
Host: [redacted]:8082
sec-ch-ua: "Chromium";v="113", "Not-A.Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.127 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Content-Type: application/x-www-form-urlencoded
Referer: http://[redacted]:8082/adm/index.php?i=acp_icons&mode=smilies
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: csrftoken=[redacted]; sessionid=[redacted]; phpbb3_83bmg_u=2; phpbb3_83bmg_k=[redacted]; phpbb3_83bmg_sid=[redacted]
Connection: close
Content-Length: 137
action=import&pak=../../../../../../../../../proc/self/fd/1&form_token=[redacted]&creation_time=1694960302
The body performs the import (action=import) and supplies the traversal in pak. The form_token is the CSRF token for the form and creation_time accompanies it. The traversal lands on /proc/self/fd/1, a file descriptor of the running PHP process. Because file tries to read that descriptor to the end, the request never completes.
The result was a timeout with no response received:

Step 2: use the error messages as a file existence oracle
The same traversal also leaks whether a file exists. If the file is not found, the error from $user->lang['PAK_FILE_NOT_READABLE'] is triggered. If the file exists but has an invalid format, the message is $user->lang['WRONG_PAK_TYPE']. The two different responses let an authenticated attacker distinguish the two cases and therefore probe which files are present on the server.
Step 3: stored XSS through the smiley image field
The second issue is in the rendering of imported smilies. The SMILEY_IMG value is not sanitised or escaped:

An attacker can therefore import a malicious emoji file whose image field contains an XSS payload. The report's example pak content is a normal list of smiley definitions, with the last entry carrying the payload in the image field:
'icon_e_biggrin.gif', '15', '17', '1', 'Very Happy', ':D',
'icon_e_biggrin.gif', '15', '17', '1', 'Very Happy', ':-D',
'icon_e_biggrin.gif', '15', '17', '1', 'Very Happy', ':grin:',
'icon_e_smile.gif', '15', '17', '1', 'Smile', ':)',
'icon_e_smile.gif', '15', '17', '1', 'Smile', ':-)',
'icon_e_smile.gif', '15', '17', '1', 'Smile', ':smile:',
'icon_e_wink.gif', '15', '17', '1', 'Wink', ';)',
'icon_e_wink.gif', '15', '17', '1', 'Wink', ';-)',
'icon_e_wink.gif', '15', '17', '1', 'Wink', ':wink:',
'icon_e_sad.gif', '15', '17', '1', 'Sad', ':(',
'icon_e_sad.gif', '15', '17', '1', 'Sad', ':-(',
'icon_e_sad.gif', '15', '17', '1', 'Sad', ':sad:',
'icon_e_surprised.gif', '15', '17', '1', 'Surprised', ':o',
'icon_e_surprised.gif', '15', '17', '1', 'Surprised', ':-o',
'icon_e_surprised.gif', '15', '17', '1', 'Surprised', ':eek:',
'icon_eek.gif', '15', '17', '1', 'Shocked', ':shock:',
'icon_e_confused.gif', '15', '17', '1', 'Confused', ':?',
'icon_e_confused.gif', '15', '17', '1', 'Confused', ':-?',
'icon_e_confused.gif', '15', '17', '1', 'Confused', ':???:',
'"onmouseover=alert() ><script>alert()</script>', '17', '18', '1', 'POC', ':POC:',
The last line is the payload: the image field is closed early and followed by an event handler and a script tag, so the markup is interpreted by the browser when the smiley is displayed. Once imported, the payload fires for everyone who views a page where that emoji appears, including the posting section, the comment section and the admin section. The report lists web defacement, cookie stealing and malware attack as consequences.
Step 4: getting a file to import without file access
Importing from a file requires the attacker to control a file on the server. The researcher's answer is PHP's handling of uploads: when PHP processes an uploaded file it creates a temporary file in /tmp and holds a file descriptor pointing at it, in the researcher's case /proc/self/fd/10. The attacker spams upload attachment requests and, at the same time, uses a race condition to import the file through that descriptor before it is deleted.
The video shows the upload requests being spammed while a small PHP file emulates the import function for demonstration. The researcher notes that the real function would behave much the same, and that opening too many tabs for the race condition while also recording would have been too heavy for the laptop.
The final result:

Root cause
The pak parameter is passed to file without sanitisation, and the existing check only blocks ordinary files such as /etc/passwd. It does not account for special files under /proc, in particular the process's own file descriptors, which can block indefinitely when read. The import path also trusts a client-supplied file name.
For the XSS, the SMILEY_IMG value is stored and later rendered without HTML entity encoding, so markup in the imported pak file becomes live markup in every page that displays the smiley. The upload race is possible because PHP keeps uploaded files in /tmp with an open descriptor, and the import function will read any path it is given.
Impact
On the denial-of-service side, an authenticated attacker can keep TCP connections open and, behind a proxy that processes requests one by one, stall all other requests until the hanging one times out. The same behaviour gives a file existence oracle through the two distinct error messages.
On the XSS side, an authenticated attacker who can get a malicious pak file imported can execute script in the browser of every user who views a page containing the emoji, across the posting, comment and admin sections. The report names web defacement, cookie stealing and malware attack as the outcomes.
Fix
The report's mitigation suggestion is to HTML entity encode data from emoji before showing it to the client, and to limit the folder from which a user can import emoji.
Variants to test
- Point
pakat other special files under/proc(for example other descriptors of the PHP process) and watch for requests that never complete. A positive result is a hanging connection rather than an error page. - Compare the responses for a non-existent path and for an existing file with invalid content. A positive result is two clearly different error messages, which confirms the file existence oracle.
- Import a pak file whose image field contains markup and load a page that renders the smiley. A positive result is the markup being interpreted rather than displayed as text.
- On targets that accept uploads, try to reach the temporary upload file through a process file descriptor while spamming uploads. A positive result is a successful import of attacker-controlled content without any file write access.
What happened, in plain words
phpBB is a popular piece of software for running online forums, the kind of site where people post messages and reply to each other. Like most forum software it has an admin area, a set of pages only the site's administrators can reach, where settings are changed. One of those pages lets an administrator manage smilies and emoji, the little faces people type into posts. That page can also import a whole set of smilies from a file, so you do not have to add each one by hand.
The researcher found two problems in that import feature. The first is that the name of the file to import is taken from the person using the page and used without any cleaning up. By putting a special kind of path into that name, an attacker can make the server try to read something that never finishes, so the request hangs forever. If the forum sits behind a proxy (a middle server that passes requests on to the real server, often one at a time), every other visitor's request has to wait behind the stuck one, and the site effectively stops responding. That is a denial of service: not stealing anything, just making the service unusable. The same trick also lets an attacker learn which files exist on the server, because the error message differs depending on whether the file is missing or just badly formatted.
The second problem is that the image name stored for each smiley is put into the page without being made safe. If an attacker can get a smiley file imported whose image name contains browser code, that code runs in the browser of every person who sees the smiley, on any page where it appears. That is stored cross-site scripting, usually shortened to stored XSS: stored because the malicious content is saved on the server, and cross-site scripting because the code runs in other people's browsers as if the site itself had written it.
Both problems need an authenticated login, because the import feature lives in the admin area. The report does not give version numbers.
The setup
The researcher tested against a phpBB installation running on their own computer. The requests in the report go to [redacted]:8082, which is the address a computer uses to talk to itself, so this was a local test copy rather than a live forum. The cookies in the requests are phpBB's own session cookies (phpbb3_83bmg_u, phpbb3_83bmg_k, phpbb3_83bmg_sid) plus a csrftoken and a sessionid. A cookie is a small piece of text a website asks your browser to keep and send back with every request, so the site can tell who you are between page loads. The browser that made the captured requests identifies itself as Chrome 113 on Windows.
For the denial-of-service test the researcher deliberately used PHP's built-in web server. PHP is the programming language phpBB is written in, and it comes with a tiny web server for development. That server handles one request at a time, which is exactly what a proxy that queues requests one by one does, so it is a faithful stand-in for that situation. For the XSS part, the researcher used a small PHP file that imitates what the import function does, purely for demonstration, and recorded the screen while using it.
Finding it
The trail starts at line 552 of a file called acp_icons.php. When phpBB imports emoji from a file, the page tells the server which file to read through a parameter called pak. A parameter is simply a named value sent with a request, like a field in a form. That value goes straight into PHP's file function, which opens a file and reads its whole contents into an array (an ordered list of lines). Nothing checks or cleans the value on the way.

There is a check in the code that stops someone reading ordinary files such as /etc/passwd, the classic file on Unix-like systems that lists user accounts, so the obvious data theft is blocked. But the check does not stop the value pointing at special files. On Linux, /proc is a virtual folder that the operating system fills with information about running programs, and /proc/self/fd/ holds the open file descriptors of the current program. A file descriptor is a number the operating system gives a program for each file or connection it has open, and reading one can behave very differently from reading a normal file. Point pak at something like /proc/self/fd/1 and the read never returns: the request hangs and the network connection stays open, which costs the server resources. If phpBB sits behind a proxy that handles requests one at a time, every later request waits for the hanging one to time out, and the hang becomes a denial of service.
While testing the import, the researcher also noticed that the SMILEY_IMG value, the field that holds the image file name for a smiley, is neither sanitised nor escaped when the page is built. Sanitising means cleaning input so it cannot do harm; escaping means converting characters that have special meaning in a page (like < and >) into harmless text so the browser shows them instead of acting on them.
Exploitation
Step 1: hang the request with a path traversal in pak
The import is triggered by sending a POST request to the admin smilies page. POST is one of the ways a browser talks to a server: it carries data in the body of the request, as opposed to a GET, which puts data in the address. The pak parameter carries a traversal sequence, a run of ../ pieces. In a file path, .. means "go up one folder", so a chain of them climbs out of the folder the server expected and lands wherever the attacker wants. Here it lands on a file descriptor of the PHP process:
POST /adm/index.php?i=acp_icons&mode=smilies¤t=delete HTTP/1.1
Host: [redacted]:8082
sec-ch-ua: "Chromium";v="113", "Not-A.Brand";v="24"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.5672.127 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Content-Type: application/x-www-form-urlencoded
Referer: http://[redacted]:8082/adm/index.php?i=acp_icons&mode=smilies
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: csrftoken=[redacted]; sessionid=[redacted]; phpbb3_83bmg_u=2; phpbb3_83bmg_k=[redacted]; phpbb3_83bmg_sid=[redacted]
Connection: close
Content-Length: 137
action=import&pak=../../../../../../../../../proc/self/fd/1&form_token=[redacted]&creation_time=1694960302
Line by line, in plain words:
POST /adm/index.php?i=acp_icons&mode=smilies¤t=delete HTTP/1.1is the first line of the request. It says: use POST, go to the admin pageadm/index.php, and the part after the?tells phpBB which page inside the admin area to show (i=acp_icons,mode=smilies).HTTP/1.1is the version of the language browsers and servers speak.Host: [redacted]:8082says which server the request is for.[redacted]is the local machine and8082is the port, the numbered door the web server listens on.- The
sec-ch-ua,sec-ch-ua-mobileandsec-ch-ua-platformlines are the browser telling the server about itself: Chromium 113, not a mobile device, Windows. Upgrade-Insecure-Requests: 1means the browser would prefer a secure (HTTPS) version of the page if one exists.User-Agentis the browser's full name badge: Chrome 113 on 64-bit Windows.Acceptlists the kinds of content the browser can handle, andAccept-EncodingandAccept-Languagesay it can take compressed responses and prefers US English.- The
Sec-Fetch-*lines are the browser describing what kind of action this is: a same-origin navigation the user asked for, ending in a document. Content-Type: application/x-www-form-urlencodedsays the body is a standard form, encoded asname=valuepairs joined by&.Referersays which page the request came from, here the smilies page itself.Cookiecarries the login session. The values are hidden here because they are secrets: anyone holding them could act as the logged-in administrator.Connection: closeasks the server to close the connection after this request instead of keeping it open for reuse.Content-Length: 137says the body is 137 bytes long.- The blank line separates the headers from the body.
- The body,
action=import&pak=../../../../../../../../../proc/self/fd/1&form_token=[redacted]&creation_time=1694960302, is the form data.action=importsays what to do.pakis the file to import, and the../chain climbs out of the expected folder and ends at/proc/self/fd/1, a file descriptor of the running PHP process.form_tokenis a security token the form carries so the server can tell a genuine submission from one forged by another site, andcreation_timetravels with it.
Because file tries to read that descriptor all the way to the end, and the end never comes, the request never completes. The result was a timeout with no response:

Step 2: use the error messages as a file existence oracle
The same traversal also reveals whether a file exists. If the file is not found, the code produces the error from $user->lang['PAK_FILE_NOT_READABLE']. If the file exists but is not a valid pak file, the message is $user->lang['WRONG_PAK_TYPE']. Those are two different messages, so an authenticated attacker can send a path and read the reply to learn which of the two situations applies. That turns the error page into an oracle, a way of asking the server yes or no questions about things the attacker cannot see directly, in this case which files are present on the server.
Step 3: stored XSS through the smiley image field
The second issue is in how imported smilies are displayed. The SMILEY_IMG value is not sanitised or escaped:

An attacker can therefore import a malicious emoji file whose image field contains an XSS payload. A payload here just means the piece of content that does the damage. The report's example pak content is an ordinary list of smiley definitions, with the last entry carrying the payload in the image field:
'icon_e_biggrin.gif', '15', '17', '1', 'Very Happy', ':D',
'icon_e_biggrin.gif', '15', '17', '1', 'Very Happy', ':-D',
'icon_e_biggrin.gif', '15', '17', '1', 'Very Happy', ':grin:',
'icon_e_smile.gif', '15', '17', '1', 'Smile', ':)',
'icon_e_smile.gif', '15', '17', '1', 'Smile', ':-)',
'icon_e_smile.gif', '15', '17', '1', 'Smile', ':smile:',
'icon_e_wink.gif', '15', '17', '1', 'Wink', ';)',
'icon_e_wink.gif', '15', '17', '1', 'Wink', ';-)',
'icon_e_wink.gif', '15', '17', '1', 'Wink', ':wink:',
'icon_e_sad.gif', '15', '17', '1', 'Sad', ':(',
'icon_e_sad.gif', '15', '17', '1', 'Sad', ':-(',
'icon_e_sad.gif', '15', '17', '1', 'Sad', ':sad:',
'icon_e_surprised.gif', '15', '17', '1', 'Surprised', ':o',
'icon_e_surprised.gif', '15', '17', '1', 'Surprised', ':-o',
'icon_e_surprised.gif', '15', '17', '1', 'Surprised', ':eek:',
'icon_eek.gif', '15', '17', '1', 'Shocked', ':shock:',
'icon_e_confused.gif', '15', '17', '1', 'Confused', ':?',
'icon_e_confused.gif', '15', '17', '1', 'Confused', ':-?',
'icon_e_confused.gif', '15', '17', '1', 'Confused', ':???:',
'"onmouseover=alert() ><script>alert()</script>', '17', '18', '1', 'POC', ':POC:',
Each line is one smiley. The fields are, in order: the image file name, the width, the height, a flag, the display name, and the text code people type to produce it. So 'icon_e_smile.gif', '15', '17', '1', 'Smile', ':)' means: show icon_e_smile.gif at 15 by 17 pixels, call it Smile, and produce it when someone types :).
The last line is the payload. Its image field starts with a double quote, which closes the attribute the page was building early, then adds onmouseover=alert(), an event handler that runs browser code when the mouse passes over the element, then ><script>alert()</script>, which closes the tag and opens a script tag. alert() is a built-in browser function that pops up a small dialog box; it is the harmless standard proof that code ran. Once imported, the payload fires for everyone who views a page where that emoji appears, including the posting section, the comment section and the admin section. The report lists web defacement (the site being visibly altered), cookie stealing (taking a visitor's session cookie to act as them) and malware attack as the consequences.
Step 4: getting a file to import without file access
Importing from a file requires the attacker to control a file on the server, and an ordinary administrator of a forum usually cannot write files to it. The researcher's answer is how PHP handles uploads. When PHP processes an uploaded file it creates a temporary file in /tmp and holds a file descriptor pointing at it, in the researcher's case /proc/self/fd/10. The attacker floods the server with upload attachment requests and, at the same time, uses a race condition to import the file through that descriptor before it is deleted. A race condition is when two things happen at once and the attacker tries to act in the tiny window between them, here between the temporary file existing and being cleaned up.
The video shows the upload requests being spammed while a small PHP file imitates the import function for demonstration. The researcher notes that the real function would behave much the same, and that opening too many tabs for the race condition while also recording would have been too heavy for the laptop.
The final result:

Root cause
The pak parameter reaches file without sanitisation, and the existing check only blocks ordinary files such as /etc/passwd. It does not consider special files under /proc, in particular the process's own file descriptors, which can block forever when read. The import path also trusts a file name supplied by the client.
For the XSS, the SMILEY_IMG value is stored and later rendered without HTML entity encoding, so markup inside an imported pak file becomes live markup on every page that shows the smiley. HTML entity encoding is the escaping mentioned earlier: turning characters like < into codes like < so the browser displays them as text. The upload race works because PHP keeps uploaded files in /tmp with an open descriptor, and the import function will read any path it is given.
Impact
On the denial-of-service side, an authenticated attacker can keep network connections open and, behind a proxy that processes requests one by one, stall every other request until the hanging one times out. The same behaviour gives a file existence oracle through the two distinct error messages.
On the XSS side, an authenticated attacker who can get a malicious pak file imported can run script in the browser of every user who views a page containing the emoji, across the posting, comment and admin sections. The report names web defacement, cookie stealing and malware attack as the outcomes.
Fix
The report's mitigation suggestion is to HTML entity encode data from emoji before showing it to the client, and to limit the folder from which a user can import emoji.
Variants to test
- Point
pakat other special files under/proc, for example other descriptors of the PHP process, and watch for requests that never complete. A positive result is a hanging connection rather than an error page. - Compare the responses for a path that does not exist and for an existing file with invalid content. A positive result is two clearly different error messages, which confirms the file existence oracle.
- Import a pak file whose image field contains markup and load a page that renders the smiley. A positive result is the markup being interpreted rather than shown as text.
- On targets that accept uploads, try to reach the temporary upload file through a process file descriptor while flooding uploads. A positive result is a successful import of attacker-controlled content without any file write access.
Glossary
- phpBB: open-source software for running online discussion forums.
- ACP (administration control panel): the admin-only area of phpBB where settings are managed.
- Smiley / emoji: a small image shown in place of a text code such as
:). - Pak file: a file listing smiley definitions that phpBB can import in one go.
- Parameter: a named value sent with a request, like a form field.
- POST: an HTTP request that carries data in its body, typically used to submit forms.
- GET: an HTTP request that carries data in the address, typically used to fetch a page.
- HTTP: the language browsers and web servers use to exchange requests and responses.
- Header: a line of metadata at the top of an HTTP request or response.
- Body: the part of a request or response that carries the actual data.
- Cookie: a small piece of text a site asks the browser to store and send back, used to keep you logged in.
- Session: the server-side record of who a logged-in user is, identified by a cookie.
- CSRF token / form token: a secret value in a form that proves the submission came from the site itself, not from another site.
- CSRF: cross-site request forgery, tricking a logged-in user's browser into submitting a request they did not intend.
- Proxy: a middle server that forwards requests to the real server, sometimes one at a time.
- Port: the numbered door on a machine that a service listens on, such as 8082.
[redacted]: the address a computer uses to reach itself (localhost).- PHP: the programming language phpBB is written in.
filefunction: a PHP function that reads a whole file into an array of lines.- Array: an ordered list of values in programming.
- Sanitise: clean input so it cannot cause harm.
- Escape / HTML entity encoding: convert characters with special meaning in a page into harmless text codes.
- Path traversal: using
../in a file path to climb out of the intended folder. - File descriptor: a number the operating system gives a program for each open file or connection.
/proc: a virtual folder on Linux exposing information about running programs./etc/passwd: a classic Unix file listing user accounts, often used as a test target.- Denial of service (DoS): making a service unusable, for example by keeping it busy.
- Timeout: the point at which a waiting request is given up on.
- TCP connection: the underlying network link between browser and server that carries HTTP.
- Oracle: a way of asking a system questions and learning from its answers, such as whether a file exists.
- XSS (cross-site scripting): getting browser code to run in another user's session on a site.
- Stored XSS: XSS where the malicious content is saved on the server and served to everyone who views it.
- Payload: the piece of content that carries out the attack.
- Event handler: an attribute such as
onmouseoverthat runs code when something happens to an element. alert(): a browser function that shows a popup, commonly used to prove code ran.- Race condition: a situation where timing between two simultaneous actions can be exploited.
- Temporary file: a short-lived file a program creates while working, here for an upload.
- Upload attachment: sending a file to the forum to attach to a post.
- Web defacement: visibly altering a site's content.
- Cookie stealing: taking a user's session cookie to act as them.
- Root cause: the underlying flaw that makes an issue possible.
- Mitigation: a change that removes or reduces a vulnerability.