Weaknesses of type CWE-22

6,562 results

Traversal de diretório (path traversal)

A aplicação recebe um caminho de arquivo fornecido pelo usuário e o usa para acessar arquivos sem validar adequadamente se o resultado fica dentro do diretório permitido. Um atacante injeta sequências como '../' ou '..' para "escapar" do diretório esperado e acessar arquivos sensíveis do sistema.

Example

Um site permite download de arquivos do diretório /uploads passando o nome via URL: download.php?file=documento.pdf. Um atacante envia file=../../etc/passwd e consegue ler arquivos fora de /uploads, porque o código não neutraliza a sequência '..'.

How to mitigate

Valide e canonicalize todo caminho fornecido pelo usuário antes de usá-lo: implemente uma whitelist de nomes permitidos, normalize caminhos para sua forma canônica, verifique se o resultado está dentro do diretório esperado, e use APIs de segurança da linguagem (ex: Path.normalize() + validação de prefix em Java, pathlib em Python).

CVE-2018-3732—resolve-path node module before 1.4.0 suffers from a Path Traversal vulnerability due to lack of validation of paths with certain special chEPSS 2.4%CVE-2021-43358HIGHSunnet eHRD - Path TraversalEPSS 2.4%CVE-2022-0779—User Meta < 2.4.4 - Subscriber+ Local File Enumeration via Path TraversalEPSS 2.4%CVE-2024-5581HIGHAllegra unzipFile Directory Traversal Remote Code Execution VulnerabilityEPSS 2.4%CVE-2023-0862HIGHPath Traversal in NetModule NSRWEPSS 2.4%CVE-2022-20718MEDIUMCisco IOx Application Hosting Environment VulnerabilitiesEPSS 2.4%CVE-2025-34118HIGHLinknat VOS Manager Path Traversal File DisclosureEPSS 2.3%CVE-2020-7497—A CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability exists in EcoStruxure Operator TerminEPSS 2.3%CVE-2022-34254HIGHAdobe Commerce Improper Limitation of a Pathname to a Restricted Directory Arbitrary code executionEPSS 2.3%CVE-2023-27562MEDIUMThe n8n package 0.218.0 for Node.js allows Directory Traversal.EPSS 2.3%CVE-2014-2352—Cogent DataHub Path TraversalEPSS 2.3%CVE-2022-1992CRITICALPath Traversal in gogs/gogsEPSS 2.3%CVE-2022-1560—Amministrazione Aperta < 3.8 - Admin+ LFIEPSS 2.3%CVE-2024-12905HIGHAn Improper Link Resolution Before File Access ("Link Following") and Improper Limitation of a Pathname to a Restricted Directory ("Path TraEPSS 2.3%CVE-2022-0369HIGHTriangle MicroWorks SCADA Data Gateway Restore Workspace Directory Traversal Remote Code Execution VulnerabilityEPSS 2.3%CVE-2025-41242MEDIUMCVE-2025-41242: Path traversal vulnerability on non-compliant Servlet containersEPSS 2.3%CVE-2024-51483MEDIUMchangedetection.io Path Traversal vulnerabilityEPSS 2.3%CVE-2025-34076MEDIUMMicroweber CMS Authenticated Local File Inclusion via Backup APIEPSS 2.3%CVE-2023-41373HIGHBIG-IP Configuration Utility vulnerabilityEPSS 2.3%CVE-2022-38088MEDIUMA directory traversal vulnerability exists in the httpd downfile.cgi functionality of Siretta QUARTZ-GOLD G5.0.1.5-210720-141020. A speciallEPSS 2.3%