← Sanil Dulal

April 2026 · 3 min read

The ../ that read the whole server

A path-traversal bug hiding in OrangeHRM's email template loader let an authenticated user walk out of the templates folder and read arbitrary files off the box. The story behind advisory GHSA-xq24-qv66-9v3m, fixed in 5.8.1.

affected
OrangeHRM 5.0 – 5.8
fixed in
5.8.1
weakness
CWE-22 · Path traversal
severity
4.6 Medium · CVSS 4.0 (GitHub)

There's a specific instinct you develop after spending enough time around web applications, and it fires the moment you see software take a filename from a user and turn it into a file on disk. The instinct is a single question: what happens if I put ../ in there?

I was poking at OrangeHRM — the open-source HR platform a lot of companies self-host to manage employees, payroll, leave, all the sensitive stuff HR touches. Somewhere in the email side of the application, it loads email templates by resolving a path. Templates are supposed to live inside a specific plugins directory. The code took a template identifier, built a path from it, and read the file back. Ordinary, unremarkable plumbing.

Except it never checked that the path it ended up with actually stayed inside the folder it was supposed to. No canonicalization, no boundary check. It just trusted that the resolved path pointed somewhere legitimate. So I fed it the thing you always try — a template path salted with ../ sequences, climbing up out of the plugins directory and back down toward files that have absolutely no business being served as an email template.

It worked. Instead of an error, the application happily read a file from well outside the templates folder and handed it back. That little jump in your chest when the server returns something it should never return — that's the moment you know you've found something real.

This is textbook path traversal, CWE-22 in the catalog: improper limitation of a pathname to a restricted directory. It's one of the oldest bug classes in the book, written about for decades, and it still ships in production software constantly — precisely because the plumbing that resolves file paths is boring, nobody wants to audit it, and everyone assumes it was done safely years ago.

The bug does require authentication — you need to be a logged-in actor who can influence the template path, so it's not an unauthenticated internet-wide catastrophe. But that framing undersells it. On an HR platform, an authenticated user is a huge population: any employee with an account. And the payoff for arbitrary file read is nasty. You're talking about reading configuration files with database credentials, application secrets, session material — anything the web process has permission to touch. Credential disclosure on a system that holds an entire organization's personal data is not a bug you shrug off.

I put together a clean writeup: the vulnerable behavior, how the template resolution fails to constrain itself to the plugins directory, a proof of concept demonstrating the traversal, and the affected versions — everything before 5.8.1. Then I reported it through OrangeHRM's security advisory process rather than dropping it in public, because giving the maintainers a window to fix it is the whole point of doing this responsibly.

It was assigned advisory GHSA-xq24-qv66-9v3m and fixed in version 5.8.1, with the resolution finally restricting template file resolution to the intended directory — which is exactly the missing check that caused the whole thing. I'm credited as the reporter.

The lesson here isn't 'path traversal exists.' Everyone knows path traversal exists. The lesson is that the decades-old, unglamorous bug classes are still the ones quietly sitting in real software, waiting, because their unglamorousness is exactly why nobody goes back to look. Finding them isn't about being clever. It's about being the person who actually tried the ../ instead of assuming someone else already had.