Common Weakness Enumeration

CWE-22

Allowed-with-Review

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Abstraction: Base · Status: Stable

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

15939 vulnerabilities reference this CWE, most recent first.

GHSA-W633-7VM3-Q65X

Vulnerability from github – Published: 2022-05-14 02:19 – Updated: 2022-05-14 02:19
VLAI
Details

An issue was discovered in damiCMS V6.0.1. There is Directory Traversal via '|' characters in the s parameter to admin.php, as demonstrated by an admin.php?s=Tpl/Add/id/c:|windows|win.ini URI.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2018-16237"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2018-08-30T22:29:00Z",
    "severity": "MODERATE"
  },
  "details": "An issue was discovered in damiCMS V6.0.1. There is Directory Traversal via \u0027|\u0027 characters in the s parameter to admin.php, as demonstrated by an admin.php?s=Tpl/Add/id/c:|windows|win.ini URI.",
  "id": "GHSA-w633-7vm3-q65x",
  "modified": "2022-05-14T02:19:51Z",
  "published": "2022-05-14T02:19:51Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2018-16237"
    },
    {
      "type": "WEB",
      "url": "https://github.com/howchen/howchen/issues/2"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-W63G-PPV3-JP39

Vulnerability from github – Published: 2022-05-14 00:59 – Updated: 2022-05-14 00:59
VLAI
Details

Absolute path traversal vulnerability in pkg_edit.php in pfSense before 2.1.4 allows remote attackers to read arbitrary XML files via a full pathname in the xml parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2014-4689"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2014-07-02T10:35:00Z",
    "severity": "MODERATE"
  },
  "details": "Absolute path traversal vulnerability in pkg_edit.php in pfSense before 2.1.4 allows remote attackers to read arbitrary XML files via a full pathname in the xml parameter.",
  "id": "GHSA-w63g-ppv3-jp39",
  "modified": "2022-05-14T00:59:56Z",
  "published": "2022-05-14T00:59:56Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2014-4689"
    },
    {
      "type": "WEB",
      "url": "https://pfsense.org/security/advisories/pfSense-SA-14_11.webgui.asc"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-W63X-8V4M-M3P4

Vulnerability from github – Published: 2026-08-27 21:31 – Updated: 2026-09-02 21:31
VLAI
Details

Arbitrary file write in /vfm-admin/index.php?section=translations&action=update in Veno File Manager Project 4.4.9 allows an authenticated user with the role of super administrator to overwrite any php file in the application via a specially crafted POST request to the affected endpoint.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-37068"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-08-27T20:17:42Z",
    "severity": "HIGH"
  },
  "details": "Arbitrary file write in /vfm-admin/index.php?section=translations\u0026action=update in Veno File Manager Project 4.4.9 allows an authenticated user with the role of super administrator to overwrite any php file in the application via a specially crafted POST request to the affected endpoint.",
  "id": "GHSA-w63x-8v4m-m3p4",
  "modified": "2026-09-02T21:31:56Z",
  "published": "2026-08-27T21:31:32Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-37068"
    },
    {
      "type": "WEB",
      "url": "https://github.com/jfs-jfs/CVE-2026-37068"
    },
    {
      "type": "WEB",
      "url": "http://veno.com"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-W658-MH9P-WW8F

Vulnerability from github – Published: 2026-10-28 22:42 – Updated: 2026-10-28 22:42
VLAI
Summary
Backstage catalog rules can be bypassed for URL locations using encoded path segments
Details

Summary

@backstage/plugin-catalog-backend matches URL-type locations against catalog.rules location patterns using the raw URL string submitted by the user, while URL readers resolve that same string in canonical form when fetching the location's content. A URL can therefore be crafted so that it appears to belong to a trusted location scope during rule evaluation, but is fetched from a different scope.

Details

When a deployment restricts catalog kinds to trusted URL prefixes using catalog.rules location patterns, DefaultCatalogRulesEnforcer applies glob matching directly to the raw location.target string. The URL readers used for ingestion resolve the same target in canonical form, including normalizing percent-encoded dot segments. A registered location such as https://<host>/trusted/%2e%2e/attacker/repo/blob/main/catalog-info.yaml matches a https://<host>/trusted/** pattern as a raw string, but resolves to and is fetched from https://<host>/attacker/repo/... when its content is read.

An authenticated user with permission to register catalog locations (catalog.location.create) can use this to have an entity from an untrusted source admitted as if it originated from a trusted location scope.

Impact

The crossed boundary is the operator-configured catalog ingestion policy: entity content from outside the trusted location scope is ingested as if it were within it. Downstream consequences depend on deployment configuration, for example actions taken with integration credentials by processors or scaffolder when acting on the ingested entity. The assessment of this report found no basis for impact claims beyond the ingestion policy boundary itself.

Patches

This is fixed in @backstage/plugin-catalog-backend 3.9.2 (Backstage release 1.54.10) and 4.0.2 (Backstage release 1.56.1). Version 4.0.1 as published is not fixed.

Workarounds

No complete workaround is available for deployments that rely on URL location patterns to restrict catalog kinds. Restricting location registration permissions reduces exposure.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@backstage/plugin-catalog-backend"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.9.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "@backstage/plugin-catalog-backend"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "4.0.0"
            },
            {
              "fixed": "4.0.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-115923"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-10-28T22:42:36Z",
    "nvd_published_at": "2026-10-26T18:17:40Z",
    "severity": "MODERATE"
  },
  "details": "## Summary\n\n`@backstage/plugin-catalog-backend` matches URL-type locations against `catalog.rules` location patterns using the raw URL string submitted by the user, while URL readers resolve that same string in canonical form when fetching the location\u0027s content. A URL can therefore be crafted so that it appears to belong to a trusted location scope during rule evaluation, but is fetched from a different scope.\n\n## Details\n\nWhen a deployment restricts catalog kinds to trusted URL prefixes using `catalog.rules` location patterns, `DefaultCatalogRulesEnforcer` applies glob matching directly to the raw `location.target` string. The URL readers used for ingestion resolve the same target in canonical form, including normalizing percent-encoded dot segments. A registered location such as `https://\u003chost\u003e/trusted/%2e%2e/attacker/repo/blob/main/catalog-info.yaml` matches a `https://\u003chost\u003e/trusted/**` pattern as a raw string, but resolves to and is fetched from `https://\u003chost\u003e/attacker/repo/...` when its content is read.\n\nAn authenticated user with permission to register catalog locations (`catalog.location.create`) can use this to have an entity from an untrusted source admitted as if it originated from a trusted location scope.\n\n## Impact\n\nThe crossed boundary is the operator-configured catalog ingestion policy: entity content from outside the trusted location scope is ingested as if it were within it. Downstream consequences depend on deployment configuration, for example actions taken with integration credentials by processors or scaffolder when acting on the ingested entity. The assessment of this report found no basis for impact claims beyond the ingestion policy boundary itself.\n\n## Patches\n\nThis is fixed in `@backstage/plugin-catalog-backend` 3.9.2 (Backstage release 1.54.10) and 4.0.2 (Backstage release 1.56.1). Version 4.0.1 as published is not fixed.\n\n## Workarounds\n\nNo complete workaround is available for deployments that rely on URL location patterns to restrict catalog kinds. Restricting location registration permissions reduces exposure.",
  "id": "GHSA-w658-mh9p-ww8f",
  "modified": "2026-10-28T22:42:36Z",
  "published": "2026-10-28T22:42:36Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/backstage/backstage/security/advisories/GHSA-w658-mh9p-ww8f"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-115923"
    },
    {
      "type": "WEB",
      "url": "https://github.com/backstage/backstage/commit/3214dc8f15d4a08a2fd07a72a8fe4d00aeac0db4"
    },
    {
      "type": "WEB",
      "url": "https://github.com/backstage/backstage/commit/737ff1c719dbd5a97f375b7f1db6d61416618419"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/backstage/backstage"
    },
    {
      "type": "WEB",
      "url": "https://github.com/backstage/backstage/releases/tag/v1.54.10"
    },
    {
      "type": "WEB",
      "url": "https://github.com/backstage/backstage/releases/tag/v1.56.1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Backstage catalog rules can be bypassed for URL locations using encoded path segments"
}

GHSA-W669-JJ7H-88M9

Vulnerability from github – Published: 2026-02-02 14:36 – Updated: 2026-02-02 14:36
VLAI
Summary
@backstage/plugin-techdocs-node vulnerable to possible Path Traversal in TechDocs Local Generator
Details

Impact

A path traversal vulnerability in the TechDocs local generator allows attackers to read arbitrary files from the host filesystem when Backstage is configured with techdocs.generator.runIn: local.

When processing documentation from untrusted sources, symlinks within the docs directory are followed by MkDocs during the build process. File contents are embedded into generated HTML and exposed to users who can view the documentation.

Patches

This vulnerability is fixed in@backstage/plugin-techdocs-node version X.X.X. Users should upgrade to this version or later.

Workarounds

  • Switch to runIn: docker in your app-config.yaml:
  techdocs:
    generator:
      runIn: docker
  • Restrict write access to TechDocs source repositories to trusted users only

References

  • https://backstage.io/docs/features/techdocs/configuration
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@backstage/plugin-techdocs-node"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.14.0"
            },
            {
              "fixed": "1.14.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ],
      "versions": [
        "1.14.0"
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "@backstage/plugin-techdocs-node"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.13.11"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-25152"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-02-02T14:36:39Z",
    "nvd_published_at": "2026-01-30T22:15:56Z",
    "severity": "MODERATE"
  },
  "details": "### Impact\nA path traversal vulnerability in the TechDocs local generator allows attackers to read arbitrary files from the host filesystem when Backstage is configured with `techdocs.generator.runIn: local`.\n\nWhen processing documentation from untrusted sources, symlinks within the docs directory are followed by MkDocs during the build process. File contents are embedded into generated HTML and exposed to users who can view the documentation.\n\n### Patches\nThis vulnerability is fixed in` @backstage/plugin-techdocs-node` version X.X.X. Users should upgrade to this version or later.\n\n### Workarounds\n- Switch to `runIn: docker` in your `app-config.yaml`:\n```yaml\n  techdocs:\n    generator:\n      runIn: docker\n```\n  - Restrict write access to TechDocs source repositories to trusted users only\n\n### References\n- https://backstage.io/docs/features/techdocs/configuration",
  "id": "GHSA-w669-jj7h-88m9",
  "modified": "2026-02-02T14:36:39Z",
  "published": "2026-02-02T14:36:39Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/backstage/backstage/security/advisories/GHSA-w669-jj7h-88m9"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-25152"
    },
    {
      "type": "WEB",
      "url": "https://github.com/backstage/backstage/commit/08f388e3394b133171fe13b62a78caf14407b9c3"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/backstage/backstage"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "@backstage/plugin-techdocs-node vulnerable to possible Path Traversal in TechDocs Local Generator"
}

GHSA-W68J-67VX-J26G

Vulnerability from github – Published: 2022-11-01 12:00 – Updated: 2022-11-02 19:00
VLAI
Details

Delta Electronics InfraSuite Device Master Versions 00.00.01a and prior mishandle .ZIP archives containing characters used in path traversal. This path traversal could result in remote code execution.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-41772"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-10-31T20:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "Delta Electronics InfraSuite Device Master Versions 00.00.01a and prior mishandle .ZIP archives containing characters used in path traversal. This path traversal could result in remote code execution.",
  "id": "GHSA-w68j-67vx-j26g",
  "modified": "2022-11-02T19:00:32Z",
  "published": "2022-11-01T12:00:37Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-41772"
    },
    {
      "type": "WEB",
      "url": "https://www.cisa.gov/uscert/ics/advisories/icsa-22-298-07"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-W6CX-QG2Q-RVQ8

Vulnerability from github – Published: 2022-03-01 22:09 – Updated: 2022-03-10 15:58
VLAI
Summary
Path Traversal in @finastra/ssr-pages
Details

A path traversal issue can occur when providing untrusted input to the svg property as an argument to the build(MessagePageOptions) function.

References

  • https://github.com/Finastra/ssr-pages/pull/1
  • https://github.com/Finastra/ssr-pages/pull/1/commits/c3e4c563384ae3ba3892f37dd190218577620780
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@finastra/ssr-pages"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0.1.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2022-24718"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2022-03-01T22:09:18Z",
    "nvd_published_at": "2022-03-01T19:15:00Z",
    "severity": "HIGH"
  },
  "details": "A path traversal issue can occur when providing untrusted input to the `svg` property as an argument to the `build(MessagePageOptions)` function.\n\n### References\n- https://github.com/Finastra/ssr-pages/pull/1\n- https://github.com/Finastra/ssr-pages/pull/1/commits/c3e4c563384ae3ba3892f37dd190218577620780\n",
  "id": "GHSA-w6cx-qg2q-rvq8",
  "modified": "2022-03-10T15:58:38Z",
  "published": "2022-03-01T22:09:18Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/Finastra/ssr-pages/security/advisories/GHSA-w6cx-qg2q-rvq8"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-24718"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Finastra/ssr-pages/pull/1"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Finastra/ssr-pages/pull/1/commits/c3e4c563384ae3ba3892f37dd190218577620780"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/Finastra/ssr-pages"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Path Traversal in @finastra/ssr-pages"
}

GHSA-W6G3-V46Q-5P28

Vulnerability from github – Published: 2018-10-17 15:49 – Updated: 2021-09-21 17:58
VLAI
Summary
Moderate severity vulnerability that affects org.apache.tika:tika-core
Details

In Apache Tika 0.9 to 1.18, in a rare edge case where a user does not specify an extract directory on the commandline (--extract-dir=) and the input file has an embedded file with an absolute path, such as "C:/evil.bat", tika-app would overwrite that file.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Maven",
        "name": "org.apache.tika:tika-core"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.9"
            },
            {
              "fixed": "1.19"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2018-11762"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2020-06-16T21:59:47Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "In Apache Tika 0.9 to 1.18, in a rare edge case where a user does not specify an extract directory on the commandline (--extract-dir=) and the input file has an embedded file with an absolute path, such as \"C:/evil.bat\", tika-app would overwrite that file.",
  "id": "GHSA-w6g3-v46q-5p28",
  "modified": "2021-09-21T17:58:38Z",
  "published": "2018-10-17T15:49:58Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2018-11762"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/advisories/GHSA-w6g3-v46q-5p28"
    },
    {
      "type": "WEB",
      "url": "https://lists.apache.org/thread.html/ab2e1af38975f5fc462ba89b517971ef892ec3d06bee12ea2258895b@%3Cdev.tika.apache.org%3E"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/105515"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Moderate severity vulnerability that affects org.apache.tika:tika-core"
}

GHSA-W6H2-Q33G-F7X5

Vulnerability from github – Published: 2022-05-17 02:09 – Updated: 2022-05-17 02:09
VLAI
Details

Multiple directory traversal vulnerabilities in Unica Affinium Campaign 7.2.1.0.55 allow remote attackers to (1) create arbitrary directories or files via a .. (dot dot) in the folder name in the new folder functionality or (2) list arbitrary files via a crafted request to Campaign/CampaignListener.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-7093"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2009-08-26T14:24:00Z",
    "severity": "MODERATE"
  },
  "details": "Multiple directory traversal vulnerabilities in Unica Affinium Campaign 7.2.1.0.55 allow remote attackers to (1) create arbitrary directories or files via a .. (dot dot) in the folder name in the new folder functionality or (2) list arbitrary files via a crafted request to Campaign/CampaignListener.",
  "id": "GHSA-w6h2-q33g-f7x5",
  "modified": "2022-05-17T02:09:36Z",
  "published": "2022-05-17T02:09:36Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-7093"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/44071"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/44075"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/31280"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/47519"
    },
    {
      "type": "WEB",
      "url": "http://www.osvdb.org/47529"
    },
    {
      "type": "WEB",
      "url": "http://www.portcullis.co.uk/287.php"
    },
    {
      "type": "WEB",
      "url": "http://www.portcullis.co.uk/291.php"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/30433"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-W6HJ-RPPP-JFVM

Vulnerability from github – Published: 2022-05-17 05:16 – Updated: 2022-05-17 05:16
VLAI
Details

Directory traversal vulnerability in index.php in phpPaleo 4.8b155 and earlier allows remote attackers to include and execute arbitrary local files via a .. (dot dot) in the lang parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2012-1671"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2012-10-08T23:55:00Z",
    "severity": "MODERATE"
  },
  "details": "Directory traversal vulnerability in index.php in phpPaleo 4.8b155 and earlier allows remote attackers to include and execute arbitrary local files via a .. (dot dot) in the lang parameter.",
  "id": "GHSA-w6hj-rppp-jfvm",
  "modified": "2022-05-17T05:16:05Z",
  "published": "2022-05-17T05:16:05Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2012-1671"
    },
    {
      "type": "WEB",
      "url": "http://osvdb.org/80100"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/48398"
    },
    {
      "type": "WEB",
      "url": "http://www.exploit-db.com/exploits/18701"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2012/03/15/11"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2012/03/16/3"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/52530"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

Mitigation MIT-5.1
Implementation

Strategy: Input Validation

  • Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • When validating filenames, use stringent allowlists that limit the character set to be used. If feasible, only allow a single "." character in the filename to avoid weaknesses such as CWE-23, and exclude directory separators such as "/" to avoid CWE-36. Use a list of allowable file extensions, which will help to avoid CWE-434.
  • Do not rely exclusively on a filtering mechanism that removes potentially dangerous characters. This is equivalent to a denylist, which may be incomplete (CWE-184). For example, filtering "/" is insufficient protection if the filesystem also supports the use of "\" as a directory separator. Another possible error could occur when the filtering is applied in a way that still produces dangerous data (CWE-182). For example, if "../" sequences are removed from the ".../...//" string in a sequential fashion, two instances of "../" would be removed from the original string, but the remaining characters would still form the "../" string.
Mitigation MIT-15
Architecture and Design

For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

Mitigation MIT-20.1
Implementation

Strategy: Input Validation

  • Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
  • Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes ".." sequences and symbolic links (CWE-23, CWE-59). This includes:
  • realpath() in C
  • getCanonicalPath() in Java
  • GetFullPath() in ASP.NET
  • realpath() or abs_path() in Perl
  • realpath() in PHP
Mitigation MIT-4
Architecture and Design

Strategy: Libraries or Frameworks

Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].

Mitigation MIT-29
Operation

Strategy: Firewall

Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].

Mitigation MIT-17
Architecture and Design Operation

Strategy: Environment Hardening

Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.

Mitigation MIT-21.1
Architecture and Design

Strategy: Enforcement by Conversion

  • When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
  • For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap [REF-185] provide this capability.
Mitigation MIT-22
Architecture and Design Operation

Strategy: Sandbox or Jail

  • Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.
  • OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.
  • This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.
  • Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-34
Architecture and Design Operation

Strategy: Attack Surface Reduction

  • Store library, include, and utility files outside of the web document root, if possible. Otherwise, store them in a separate directory and use the web server's access control capabilities to prevent attackers from directly requesting them. One common practice is to define a fixed constant in each calling program, then check for the existence of the constant in the library/include file; if the constant does not exist, then the file was directly requested, and it can exit immediately.
  • This significantly reduces the chance of an attacker being able to bypass any protection mechanisms that are in the base program but not in the include files. It will also reduce the attack surface.
Mitigation MIT-39
Implementation
  • Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success.
  • If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files.
  • Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
  • In the context of path traversal, error messages which disclose path information can help attackers craft the appropriate attack strings to move through the file system hierarchy.
Mitigation MIT-16
Operation Implementation

Strategy: Environment Hardening

When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.

CAPEC-126: Path Traversal

An adversary uses path manipulation methods to exploit insufficient input validation of a target to obtain access to data that should be not be retrievable by ordinary well-formed requests. A typical variety of this attack involves specifying a path to a desired file together with dot-dot-slash characters, resulting in the file access API or function traversing out of the intended directory structure and into the root file system. By replacing or modifying the expected path information the access function or API retrieves the file desired by the attacker. These attacks either involve the attacker providing a complete path to a targeted file or using control characters (e.g. path separators (/ or \) and/or dots (.)) to reach desired directories or files.

CAPEC-64: Using Slashes and URL Encoding Combined to Bypass Validation Logic

This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple ways of encoding a URL and abuse the interpretation of the URL. A URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.

CAPEC-76: Manipulating Web Input to File System Calls

An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.

CAPEC-78: Using Escaped Slashes in Alternate Encoding

This attack targets the use of the backslash in alternate encoding. An adversary can provide a backslash as a leading character and causes a parser to believe that the next character is special. This is called an escape. By using that trick, the adversary tries to exploit alternate ways to encode the same character which leads to filter problems and opens avenues to attack.

CAPEC-79: Using Slashes in Alternate Encoding

This attack targets the encoding of the Slash characters. An adversary would try to exploit common filtering problems related to the use of the slashes characters to gain access to resources on the target host. Directory-driven systems, such as file systems and databases, typically use the slash character to indicate traversal between directories or other container components. For murky historical reasons, PCs (and, as a result, Microsoft OSs) choose to use a backslash, whereas the UNIX world typically makes use of the forward slash. The schizophrenic result is that many MS-based systems are required to understand both forms of the slash. This gives the adversary many opportunities to discover and abuse a number of common filtering problems. The goal of this pattern is to discover server software that only applies filters to one version, but not the other.