Application vulnerabilities

Path traversal

directory traversal · dot-dot-slash · file path traversal · CWE-22 · traversée de répertoires

A flaw that lets an attacker break out of the folder an application intended by manipulating a file name, in order to read or write sensitive files elsewhere on the server.

In practice

It appears when an application receives a file name or path (a download, an image, a template, an archive to unpack) and uses it unchecked. By climbing up the directory tree, an attacker can read configuration files containing passwords or keys, or even drop an executable file. The flaw is well understood and avoidable, yet in May 2024 CISA’s catalogue of actively exploited vulnerabilities listed 55 of this type.

Example

In May 2024, CISA and the FBI devoted a “Secure by Design” alert to this flaw, following campaigns that exploited, among others, CVE-2024-1708 in the ConnectWise ScreenConnect remote access software and hit critical sectors, including healthcare.

How to protect yourself

  • Never build a path from raw input: use generated identifiers and a lookup table.
  • Normalise the path, then check that it stays inside the permitted folder.
  • Restrict the characters allowed in file names (letters and digits).
  • Run the application under an account that can only reach its own files.

Sources

The whole glossary

From theory to practice

So how does your system measure up?

Create your account and get an A+ to F grade for your domains’ encryption in minutes, with every finding explained and the fix to apply.

Run the audit from your account: an A+ to F grade for your domains’ encryption in minutes, with every finding explained and the fix to apply.

Belinda

Contact us

A question, a project, a partnership? Write to us: the team answers by email, usually within one business day.

Your details are only used to answer you. Do not include passwords or vulnerability details.