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.

13001 vulnerabilities reference this CWE, most recent first.

GHSA-4343-27R5-P3V9

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

Directory traversal vulnerability in the WAP interface in Trihedral VTScada (formerly VTS) 8.x through 11.x before 11.2.02 allows remote attackers to read arbitrary files via a crafted pathname.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2016-4532"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2016-06-09T10:59:00Z",
    "severity": "CRITICAL"
  },
  "details": "Directory traversal vulnerability in the WAP interface in Trihedral VTScada (formerly VTS) 8.x through 11.x before 11.2.02 allows remote attackers to read arbitrary files via a crafted pathname.",
  "id": "GHSA-4343-27r5-p3v9",
  "modified": "2022-05-17T03:41:05Z",
  "published": "2022-05-17T03:41:05Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2016-4532"
    },
    {
      "type": "WEB",
      "url": "https://ics-cert.us-cert.gov/advisories/ICSA-16-159-01"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/91077"
    },
    {
      "type": "WEB",
      "url": "http://www.zerodayinitiative.com/advisories/ZDI-16-403"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-435H-73R2-VF64

Vulnerability from github – Published: 2024-08-01 21:31 – Updated: 2024-08-01 21:31
VLAI
Details

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Crocoblock JetWidgets for Elementor and WooCommerce allows PHP Local File Inclusion.This issue affects JetWidgets for Elementor and WooCommerce: from n/a through 1.1.7.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-38772"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2024-08-01T21:15:28Z",
    "severity": "MODERATE"
  },
  "details": "Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027) vulnerability in Crocoblock JetWidgets for Elementor and WooCommerce allows PHP Local File Inclusion.This issue affects JetWidgets for Elementor and WooCommerce: from n/a through 1.1.7.",
  "id": "GHSA-435h-73r2-vf64",
  "modified": "2024-08-01T21:31:40Z",
  "published": "2024-08-01T21:31:40Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-38772"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/vulnerability/jetwoo-widgets-for-elementor/wordpress-jetwidgets-for-elementor-and-woocommerce-plugin-1-1-7-contributor-limited-local-file-inclusion-vulnerability?_s_id=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-4365-FHM5-QCRX

Vulnerability from github – Published: 2021-10-22 16:19 – Updated: 2024-10-16 20:45
VLAI
Summary
Maliciously Crafted Model Archive Can Lead To Arbitrary File Write
Details

Impact

An Archive Extraction (Zip Slip) vulnerability in the functionality that allows a user to load a trained model archive in Rasa 2.8.9 and older allows an attacker arbitrary write capability within specific directories using a malicious crafted archive file.

Patches

The vulnerability is fixed in Rasa 2.8.10

Workarounds

Mitigating steps for vulnerable end users are to ensure that they do not upload untrusted model files, and restrict CLI or API endpoint access where a malicious actor could target a deployed Rasa instance.

For more information

If you have any questions or comments about this advisory: * Email the Rasa Security Team

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "rasa"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.8.10"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2021-41127"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22",
      "CWE-23"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2021-10-21T20:32:19Z",
    "nvd_published_at": "2021-10-21T21:15:00Z",
    "severity": "HIGH"
  },
  "details": "### Impact\nAn Archive Extraction (Zip Slip) vulnerability in the functionality that allows a user to load a trained model archive in Rasa 2.8.9 and older allows an attacker arbitrary write capability within specific directories using a malicious crafted archive file.\n\n### Patches\nThe vulnerability is fixed in Rasa 2.8.10\n\n### Workarounds\nMitigating steps for vulnerable end users are to ensure that they do not upload untrusted model files, and restrict CLI or API endpoint access where a malicious actor could target a deployed Rasa instance.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email [the Rasa Security Team](mailto:security@rasa.com)\n",
  "id": "GHSA-4365-fhm5-qcrx",
  "modified": "2024-10-16T20:45:22Z",
  "published": "2021-10-22T16:19:13Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/RasaHQ/rasa/security/advisories/GHSA-4365-fhm5-qcrx"
    },
    {
      "type": "WEB",
      "url": "https://github.com/RasaHQ/rasa/commit/1b6b502f52d73b4f8cd1959ce724b8ad0eb33989"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/RasaHQ/rasa"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pypa/advisory-database/tree/main/vulns/rasa/PYSEC-2021-381.yaml"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Maliciously Crafted Model Archive Can Lead To Arbitrary File Write"
}

GHSA-436J-FFF5-MQ27

Vulnerability from github – Published: 2022-05-02 03:15 – Updated: 2022-05-02 03:15
VLAI
Details

Directory traversal vulnerability in index.php in Php Photo Album (PHPPA) 0.8 BETA allows remote attackers to include and execute arbitrary local files via a .. (dot dot) in the preview parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2009-0423"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2009-02-05T00:30:00Z",
    "severity": "HIGH"
  },
  "details": "Directory traversal vulnerability in index.php in Php Photo Album (PHPPA) 0.8 BETA allows remote attackers to include and execute arbitrary local files via a .. (dot dot) in the preview parameter.",
  "id": "GHSA-436j-fff5-mq27",
  "modified": "2022-05-02T03:15:21Z",
  "published": "2022-05-02T03:15:21Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2009-0423"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/48017"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/7786"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/33277"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-436M-M73C-VQ4G

Vulnerability from github – Published: 2026-07-14 15:32 – Updated: 2026-07-14 18:31
VLAI
Details

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') vulnerability in Apache OpenMeetings.

This issue affects Apache OpenMeetings: from 5.0.0 before 9.1.0. An attacker with moderator rights in any room can read arbitrary files accessible to the OS account running the OM server, including credentials and secrets, via a crafted download request.

Users are recommended to upgrade to version 9.1.0, which fixes the issue.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-49488"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-07-14T13:18:57Z",
    "severity": "MODERATE"
  },
  "details": "Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027) vulnerability in Apache OpenMeetings.\n\nThis issue affects Apache OpenMeetings: from 5.0.0 before 9.1.0.\nAn attacker with moderator rights in any room can read arbitrary files accessible to the OS account running the OM server, including credentials and secrets, via a crafted download request.\n\nUsers are recommended to upgrade to version 9.1.0, which fixes the issue.",
  "id": "GHSA-436m-m73c-vq4g",
  "modified": "2026-07-14T18:31:54Z",
  "published": "2026-07-14T15:32:16Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-49488"
    },
    {
      "type": "WEB",
      "url": "https://lists.apache.org/thread/74zf32shox9oy62b7t55mvcj874bxqnj"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2026/07/14/10"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-436V-RWRW-9MFH

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

Directory traversal vulnerability in portfolio/css.php in Cyberfolio 7.12.2 and earlier allows remote attackers to include and execute arbitrary local files via a .. (dot dot) in the theme parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-6265"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2009-02-24T18:30:00Z",
    "severity": "MODERATE"
  },
  "details": "Directory traversal vulnerability in portfolio/css.php in Cyberfolio 7.12.2 and earlier allows remote attackers to include and execute arbitrary local files via a .. (dot dot) in the theme parameter.",
  "id": "GHSA-436v-rwrw-9mfh",
  "modified": "2022-05-17T00:40:42Z",
  "published": "2022-05-17T00:40:42Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-6265"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/46490"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/7065"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/32218"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2008/3070"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-439C-M266-7555

Vulnerability from github – Published: 2022-05-02 00:11 – Updated: 2022-05-02 00:11
VLAI
Details

Directory traversal vulnerability in index.php in Sports Clubs Web Panel 0.0.1 allows remote attackers to include and execute arbitrary local files via a .. (dot dot) in the p parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-4592"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2008-10-16T18:00:00Z",
    "severity": "HIGH"
  },
  "details": "Directory traversal vulnerability in index.php in Sports Clubs Web Panel 0.0.1 allows remote attackers to include and execute arbitrary local files via a .. (dot dot) in the p parameter.",
  "id": "GHSA-439c-m266-7555",
  "modified": "2022-05-02T00:11:41Z",
  "published": "2022-05-02T00:11:41Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-4592"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/45062"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/6427"
    },
    {
      "type": "WEB",
      "url": "http://securityreason.com/securityalert/4423"
    },
    {
      "type": "WEB",
      "url": "http://www.vupen.com/english/advisories/2008/2550"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-43C9-GW4X-PCX6

Vulnerability from github – Published: 2025-01-21 20:11 – Updated: 2025-01-21 20:11
VLAI
Summary
Authenticated arbitrary file deletion in YesWiki
Details

Authenticated arbitrary file deletion in YesWiki <= 4.4.5

Summary

It is possible for any authenticated user, through the use of the filemanager to delete any file owned by the user running the FastCGI Process Manager (FPM) on the host without any limitation on the filesystem's scope.

This Proof of Concept has been performed using the followings: - YesWiki v4.4.5 (doryphore-dev branch, latest) - Docker environnment (docker/docker-compose.yml) - Docker v27.5.0 - Default installation

Details

The vulnerability makes use of the filemanager that allows a user to manage files that are attached to a resource when they have owner permission on it. This part of the code is managed in tools/attach/libs/attach.lib.php

public function doFileManager($isAction = false)
{
    $do = (isset($_GET['do']) && $_GET['do']) ? $_GET['do'] : '';
    switch ($do) {
        case 'restore':
            $this->fmRestore();
            $this->fmShow(true, $isAction);
            break;
        case 'erase':
            $this->fmErase();
            $this->fmShow(true, $isAction);
            break;
        case 'del':
            $this->fmDelete();
            $this->fmShow(false, $isAction);
            break;
        case 'trash':
            $this->fmShow(true, $isAction);
            break;
        case 'emptytrash':
            $this->fmEmptyTrash(); //pas de break car apres un emptytrash => retour au gestionnaire
            // no break
        default:
            $this->fmShow(false, $isAction);
    }
}

The fmErase() function doesn't sanitize or verify the path that has been provided by the user in any way. Thus allowing a malicious user to specify any arbitrary file on the filesystem and having it deleted through the use of unlink() (as long as the user that runs the process has permission to delete it).

public function fmErase()
{
    $path = $this->GetUploadPath();
    $filename = $path . '/' . ($_GET['file'] ? $_GET['file'] : '');
    if (file_exists($filename)) {
        unlink($filename);
    }
}

In addition to this deletion accross all the filesystem through fmErase(), it is also possible to delete any file attached to an existing wiki page, for instance, if user A creates a page and attaches images/documents to it, they always get uploaded to the files/ directory. If user B (malicious), knows the path of the files he can also arbitrarly delete them. (fmDelete() is also impacted by this case)

PoC

1. Environnement setup

The following actions have been performed as a privileged user

First, let's create one user (in addition to the WikiAdmin user):

poc1

Restrict the edition of 'PagePrincipale' wiki page to administrators only:

poc2

2. Upload of a file on a resource not owned by our user

The following actions have been performed as a privileged user

Second, let's upload a media to this PagePrincipale wiki page:

poc3 poc4

Then view it in the page's filemanager:

poc5

We can confirm that our file has been uploaded to the files/ directory by directly looking at the yeswiki container:

poc5 1

3. Arbitrary deletion (in files/)

The following actions have been performed using an unprivileged user

Now, get the full path/name of the media in the files directory by opening it in a new tab:

poc6

Afterwards, we need an instance of filemanager to be accessible to our user so we need to create a page that we own, here is used the agenda and the creation of a new event:

poc7

Call the erase method on the PagePrincipale's uploaded media:

poc

The media is now deleted from PagePrincipale (the button is shown when the attached media doesn't exist, it's an intended behaviour):

poc9

It has also disappeared from the files/ directory:

poc10

This behaviour can be applied to any file under the files/ directory.

4. Arbitrary deletion (in /tmp/)

The following actions have been performed using a privileged access

Finally, using the same user as the process running the app, we create a file under the /tmp directory:

poc11

The following actions have been performed using an unprivileged user

We can once again call the erase method using a relative path:

poc3

The file isn't here anymore:

poc13

Impact

This vulnerability allows any authenticated user to arbitrarly remove content from the Wiki resulting in partial loss of data and defacement/deteroriation of the website. In the context of a container installation of YesWiki without any modification, the 'yeswiki' files (for example .php) are not owned by the same user (root) as the one running the FPM process (www-data). However in a standard installation, www-data may also be the owner of the PHP files, allowing a malicious user to completely cut the access to the wiki by deleting all important PHP files (like index.php or core files of YesWiki).

Suggestion of possible corrective measures

  • Restrict the possible paths of fmErase() to the upload_path directory.

  • Restrict the use of fmErase() to trashed files only.

public function fmErase()
{
    $path = $this->GetUploadPath();
    $filename = $this->GetUploadPath() . '/' . basename(realpath(($_GET['file'] ? $_GET['file'] : ''))); //Sanitize file path
    if (file_exists($filename) && preg_match('/trash\d{14}$/', $filename)) { //Make sure that the filename ends with trash and a date
        unlink($filename);
    }
}
  • Make sure that any request to fmErase() or fmDelete() originates from the owner of the resource to which the attachment is linked (asks a bit more than a few lines of code).
Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 4.4.5"
      },
      "package": {
        "ecosystem": "Packagist",
        "name": "yeswiki/yeswiki"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "4.5.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-24019"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-01-21T20:11:37Z",
    "nvd_published_at": "2025-01-21T18:15:17Z",
    "severity": "HIGH"
  },
  "details": "# Authenticated arbitrary file deletion in YesWiki \u003c= 4.4.5\n\n### Summary\nIt is possible for any authenticated user, through the use of the filemanager to delete any file owned by the user running the FastCGI Process Manager (FPM) on the host without any limitation on the filesystem\u0027s scope.\n\nThis Proof of Concept has been performed using the followings:\n- YesWiki v4.4.5 (`doryphore-dev` branch, latest)\n- Docker environnment (`docker/docker-compose.yml`)\n- Docker v27.5.0\n- Default installation\n\n### Details\nThe vulnerability makes use of the `filemanager` that allows a user to manage files that are attached to a resource when they have owner permission on it. This part of the code is managed in `tools/attach/libs/attach.lib.php`\n\n```php\npublic function doFileManager($isAction = false)\n{\n    $do = (isset($_GET[\u0027do\u0027]) \u0026\u0026 $_GET[\u0027do\u0027]) ? $_GET[\u0027do\u0027] : \u0027\u0027;\n    switch ($do) {\n        case \u0027restore\u0027:\n            $this-\u003efmRestore();\n            $this-\u003efmShow(true, $isAction);\n            break;\n        case \u0027erase\u0027:\n            $this-\u003efmErase();\n            $this-\u003efmShow(true, $isAction);\n            break;\n        case \u0027del\u0027:\n            $this-\u003efmDelete();\n            $this-\u003efmShow(false, $isAction);\n            break;\n        case \u0027trash\u0027:\n            $this-\u003efmShow(true, $isAction);\n            break;\n        case \u0027emptytrash\u0027:\n            $this-\u003efmEmptyTrash(); //pas de break car apres un emptytrash =\u003e retour au gestionnaire\n            // no break\n        default:\n            $this-\u003efmShow(false, $isAction);\n    }\n}\n```\n\nThe **[fmErase()](https://github.com/YesWiki/yeswiki/blob/doryphore-dev/tools/attach/libs/attach.lib.php#L999)** function doesn\u0027t sanitize or verify the path that has been provided by the user in any way. Thus allowing a malicious user to specify any arbitrary file on the filesystem and having it deleted through the use of `unlink()` (as long as the user that runs the process has permission to delete it).\n\n```php\npublic function fmErase()\n{\n    $path = $this-\u003eGetUploadPath();\n    $filename = $path . \u0027/\u0027 . ($_GET[\u0027file\u0027] ? $_GET[\u0027file\u0027] : \u0027\u0027);\n    if (file_exists($filename)) {\n        unlink($filename);\n    }\n}\n```\n\nIn addition to this deletion accross all the filesystem through `fmErase()`, it is also possible to delete any file attached to an existing wiki page, for instance, if user A creates a page and attaches images/documents to it, they always get uploaded to the files/ directory. If user B (malicious), knows the path of the files he can also arbitrarly delete them. (**[fmDelete()](https://github.com/YesWiki/yeswiki/blob/doryphore-dev/tools/attach/libs/attach.lib.php#L1011)** is also impacted by this case)\n\n### PoC\n#### 1. Environnement setup\n\u003e The following actions have been performed as a privileged user\n\nFirst, let\u0027s create one user (in addition to the WikiAdmin user):\n\n![poc1](https://github.com/user-attachments/assets/f977106e-0618-4594-a673-14840ed6cb83)\n\nRestrict the edition of \u0027PagePrincipale\u0027 wiki page to administrators only:\n\n![poc2](https://github.com/user-attachments/assets/c40c43dd-1b4f-48fc-b425-9d7915c626bc)\n\n#### 2. Upload of a file on a resource not owned by our user\n\u003e The following actions have been performed as a privileged user\n\nSecond, let\u0027s upload a media to this `PagePrincipale` wiki page:\n\n![poc3](https://github.com/user-attachments/assets/da1cf714-34d6-4d06-8768-f6e0984172fe)\n![poc4](https://github.com/user-attachments/assets/3391986d-8d65-4ed0-b614-b71e9938846e)\n\nThen view it in the page\u0027s filemanager:\n\n![poc5](https://github.com/user-attachments/assets/821bb42c-9cb7-4209-82ac-a5884cc57eb4)\n\nWe can confirm that our file has been uploaded to the `files/` directory by directly looking at the `yeswiki` container:\n\n![poc5 1](https://github.com/user-attachments/assets/629c88c5-744a-4203-b017-03abded00ca5)\n\n#### 3. Arbitrary deletion (in files/)\n\u003e The following actions have been performed using an unprivileged user\n\nNow, get the full path/name of the media in the files directory by opening it in a new tab:\n\n![poc6](https://github.com/user-attachments/assets/43cdc5f6-5e05-4797-91d8-3bed0142d72a)\n\nAfterwards, we need an instance of filemanager to be accessible to our user so we need to create a page that we own, here is used the agenda and the creation of a new event:\n\n![poc7](https://github.com/user-attachments/assets/1ef17353-04d0-42c8-8a80-dc9f10ca7f80)\n\nCall the `erase` method on the PagePrincipale\u0027s uploaded media:\n\n![poc](https://github.com/user-attachments/assets/9d05fe78-a8ec-4835-b480-297d0f8fc037)\n\nThe media is now deleted from PagePrincipale (the button is shown when the attached media doesn\u0027t exist, it\u0027s an intended behaviour):\n\n![poc9](https://github.com/user-attachments/assets/5d20ae80-0eaa-48c1-8411-fd1c5632f524)\n\nIt has also disappeared from the `files/` directory:\n\n![poc10](https://github.com/user-attachments/assets/a6b3e305-ec4f-4ffb-b5df-34bfddf198b3)\n\nThis behaviour can be applied to **any** file under the `files/` directory.\n\n#### 4. Arbitrary deletion (in /tmp/)\n\u003e The following actions have been performed using a privileged access\n\nFinally, using the same user as the process running the app, we create a file under the `/tmp` directory:\n\n![poc11](https://github.com/user-attachments/assets/45befa45-1023-4aed-b55a-f49864eb2174)\n\n\u003e The following actions have been performed using an unprivileged user\n\nWe can once again call the `erase` method using a relative path:\n\n![poc3](https://github.com/user-attachments/assets/b9ee7d19-5f2c-4de3-9a8d-5049c2480d3e)\n\nThe file isn\u0027t here anymore:\n\n![poc13](https://github.com/user-attachments/assets/1ec440b6-cc95-40b5-b061-22fc46b8ae67)\n\n### Impact\nThis vulnerability allows any authenticated user to arbitrarly remove content from the Wiki resulting in partial loss of data and defacement/deteroriation of the website. In the context of a container installation of YesWiki without any modification, the \u0027yeswiki\u0027 files (for example .php) are not owned by the same user (root) as the one running the FPM process (www-data). However in a standard installation, www-data may also be the owner of the PHP files, allowing a malicious user to completely cut the access to the wiki by deleting all important PHP files (like index.php or core files of YesWiki).\n\n### Suggestion of possible corrective measures\n\n- Restrict the possible paths of `fmErase()` to the `upload_path` directory.\n\n- Restrict the use of `fmErase()` to trashed files only.\n\n```php\npublic function fmErase()\n{\n    $path = $this-\u003eGetUploadPath();\n    $filename = $this-\u003eGetUploadPath() . \u0027/\u0027 . basename(realpath(($_GET[\u0027file\u0027] ? $_GET[\u0027file\u0027] : \u0027\u0027))); //Sanitize file path\n    if (file_exists($filename) \u0026\u0026 preg_match(\u0027/trash\\d{14}$/\u0027, $filename)) { //Make sure that the filename ends with trash and a date\n        unlink($filename);\n    }\n}\n```\n\n- Make sure that any request to `fmErase()` or `fmDelete()` originates from the owner of the resource to which the attachment is linked (asks a bit more than a few lines of code).\n\n",
  "id": "GHSA-43c9-gw4x-pcx6",
  "modified": "2025-01-21T20:11:37Z",
  "published": "2025-01-21T20:11:37Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/YesWiki/yeswiki/security/advisories/GHSA-43c9-gw4x-pcx6"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-24019"
    },
    {
      "type": "WEB",
      "url": "https://github.com/YesWiki/yeswiki/commit/3ddd833d22703caf9025659eb174f7765df7147c"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/YesWiki/yeswiki"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Authenticated arbitrary file deletion in YesWiki"
}

GHSA-43F3-H63W-P6F6

Vulnerability from github – Published: 2024-10-07 15:10 – Updated: 2024-10-08 14:19
VLAI
Summary
Saltcorn Server allows logged-in users to delete arbitrary files because of a path traversal vulnerability
Details

Summary

A logged-in user with any role can delete arbitrary files on the filesystem by calling the sync/clean_sync_dir endpoint. The dir_name POST parameter is not validated/sanitized and is used to construct the syncDir that is deleted by calling fs.rm.

Details

  • file: https://github.com/saltcorn/saltcorn/blob/v1.0.0-beta.15/packages/server/routes/sync.js#L337-L346
router.post(
  "/clean_sync_dir",
  error_catcher(async (req, res) => {
    const { dir_name } = req.body; // [1] source
    try {
      const rootFolder = await File.rootFolder();
      const syncDir = path.join(
        rootFolder.location,
        "mobile_app",
        "sync",
        dir_name // [2]
      );
      await fs.rm(syncDir, { recursive: true, force: true }); // [3] sink
      res.status(200).send("");
    } catch (error) {
      getState().log(2, `POST /sync/clean_sync_dir: '${error.message}'`);
      res.status(400).json({ error: error.message || error });
    }
  })
);

PoC

The following PoC can be executed with a user with any role (admin, staff, user, public)

  • create a file in a folder different from where the server is started:
touch /tmp/secret
cat /tmp/secret
  • log with a user and retrieve valid connect.sid and _csrf values***
  • send the following curl request
curl -i -X $'POST' \
  -H $'Host: localhost:3000' \
  -H $'Content-Type: application/x-www-form-urlencoded' \
  -H $'Content-Length: 93' \
  -H $'Origin: http://localhost:3000' \
  -H $'Connection: close' \
  -b $'connect.sid=VALID_CONNECT_SID_COOKIE; loggedin=true' \
  --data-binary $'_csrf=VALID_CSRF_VALUE&dir_name=/../../../../../../../../../../tmp/secret' \
  $'http://localhost:3000/sync/clean_sync_dir'
  • check if the file previously created does not exist anymore:
cat /tmp/secret
cat: /tmp/secret: No such file or directory

*** obtain connect.sid and _csrf values

A possible way to retrieve connect.sid and _csrf values is to use the password reset functionality: - log in - open the browser developer console, go to the Network tab filter for settings request - visit http://localhost:3000/auth/settings - trigger the change password functionality - under the Headers and Request tabs, grab the connect.sid and _csrf values and replace them in the curl command

Impact

Arbitrary file delete

Recommended Mitigation

Resolve the syncDir and check if it starts with rootFolder.location/mobile_app/sync.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 1.0.0-beta.15"
      },
      "package": {
        "ecosystem": "npm",
        "name": "@saltcorn/server"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.0.0-beta.16"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-47818"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-10-07T15:10:52Z",
    "nvd_published_at": "2024-10-07T22:15:04Z",
    "severity": "HIGH"
  },
  "details": "### Summary\n\nA logged-in user with any role can delete arbitrary files on the filesystem by calling the `sync/clean_sync_dir` endpoint. The `dir_name` POST parameter is not validated/sanitized and is used to construct the `syncDir` that is deleted by calling `fs.rm`.\n\n### Details\n\n- file: https://github.com/saltcorn/saltcorn/blob/v1.0.0-beta.15/packages/server/routes/sync.js#L337-L346\n\n```js\nrouter.post(\n  \"/clean_sync_dir\",\n  error_catcher(async (req, res) =\u003e {\n    const { dir_name } = req.body; // [1] source\n    try {\n      const rootFolder = await File.rootFolder();\n      const syncDir = path.join(\n        rootFolder.location,\n        \"mobile_app\",\n        \"sync\",\n        dir_name // [2]\n      );\n      await fs.rm(syncDir, { recursive: true, force: true }); // [3] sink\n      res.status(200).send(\"\");\n    } catch (error) {\n      getState().log(2, `POST /sync/clean_sync_dir: \u0027${error.message}\u0027`);\n      res.status(400).json({ error: error.message || error });\n    }\n  })\n);\n```\n\n\n### PoC\n\nThe following PoC can be executed with a user with any role (`admin`, `staff`, `user`, `public`)\n\n- create a file in a folder different from where the server is started:\n```\ntouch /tmp/secret\ncat /tmp/secret\n```\n\n- log with a user and retrieve valid `connect.sid` and `_csrf` values***\n- send the following `curl` request\n```\ncurl -i -X $\u0027POST\u0027 \\\n  -H $\u0027Host: localhost:3000\u0027 \\\n  -H $\u0027Content-Type: application/x-www-form-urlencoded\u0027 \\\n  -H $\u0027Content-Length: 93\u0027 \\\n  -H $\u0027Origin: http://localhost:3000\u0027 \\\n  -H $\u0027Connection: close\u0027 \\\n  -b $\u0027connect.sid=VALID_CONNECT_SID_COOKIE; loggedin=true\u0027 \\\n  --data-binary $\u0027_csrf=VALID_CSRF_VALUE\u0026dir_name=/../../../../../../../../../../tmp/secret\u0027 \\\n  $\u0027http://localhost:3000/sync/clean_sync_dir\u0027\n```\n\n- check if the file previously created does not exist anymore:\n```\ncat /tmp/secret\ncat: /tmp/secret: No such file or directory\n```\n\n*** obtain `connect.sid` and `_csrf` values\n\nA possible way to retrieve `connect.sid` and `_csrf` values is to use the password reset functionality:\n- log in\n- open the browser developer console, go to the `Network` tab filter for `settings` request\n- visit `http://localhost:3000/auth/settings`\n- trigger the change password functionality\n- under the `Headers` and `Request` tabs, grab the `connect.sid` and `_csrf` values and replace them in the curl command \n\n### Impact\n\nArbitrary file delete\n\n### Recommended Mitigation\n\nResolve the `syncDir` and check if it starts with `rootFolder.location/mobile_app/sync`.",
  "id": "GHSA-43f3-h63w-p6f6",
  "modified": "2024-10-08T14:19:02Z",
  "published": "2024-10-07T15:10:52Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/saltcorn/saltcorn/security/advisories/GHSA-43f3-h63w-p6f6"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-47818"
    },
    {
      "type": "WEB",
      "url": "https://github.com/saltcorn/saltcorn/commit/3c551261d0e230635774798009951fa83a07cc3a"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/saltcorn/saltcorn"
    },
    {
      "type": "WEB",
      "url": "https://github.com/saltcorn/saltcorn/blob/v1.0.0-beta.15/packages/server/routes/sync.js#L337-L346"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Saltcorn Server allows logged-in users to delete arbitrary files because of a path traversal vulnerability"
}

GHSA-43FC-QCR8-6G6R

Vulnerability from github – Published: 2022-05-24 19:07 – Updated: 2022-05-24 19:07
VLAI
Details

Multiple Path traversal vulnerabilities in the Webmail of FortiMail before 6.4.4 may allow a regular user to obtain unauthorized access to files and data via specifically crafted web requests.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-24013"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2021-07-12T14:15:00Z",
    "severity": "MODERATE"
  },
  "details": "Multiple Path traversal vulnerabilities in the Webmail of FortiMail before 6.4.4 may allow a regular user to obtain unauthorized access to files and data via specifically crafted web requests.",
  "id": "GHSA-43fc-qcr8-6g6r",
  "modified": "2022-05-24T19:07:31Z",
  "published": "2022-05-24T19:07:31Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-24013"
    },
    {
      "type": "WEB",
      "url": "https://fortiguard.com/advisory/FG-IR-21-014"
    }
  ],
  "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.