Summary
A Zip Slip path traversal vulnerability in changedetection.io's backup restore feature allows files from an uploaded ZIP archive to be extracted outside the intended directory.
If an attacker can upload a crafted backup ZIP, they may overwrite arbitrary files on the server, potentially leading to full system compromise depending on what files are replaced.
Affected context
The vulnerability occurs in changedetection.io deployments that allow users to upload backup ZIP archives for restore.
During restoration, file paths from the ZIP entries are not sufficiently validated or normalized, so crafted paths containing directory traversal sequences (for example, using ../) may escape the intended backup directory.
This risk is most relevant in environments where attackers can submit or control backup ZIP uploads, such as exposed admin interfaces or shared/self-service instances.
Exploit preconditions
- Attack surface: HTTP interface or any feature that accepts backup ZIP uploads for restore.
- Required access: Ability to authenticate or otherwise reach the backup restore endpoint and upload a ZIP file (often admin-level or privileged user, but may vary by deployment).
- Trigger point: Invoking the backup restore functionality with a maliciously crafted ZIP archive that includes directory traversal paths in filenames.
- Why exploitation is possible: The restore logic trusts the file paths inside the ZIP archive and writes them to the filesystem without enforcing a fixed extraction root or rejecting paths that resolve outside the intended backup directory.
Why this happens
This issue stems from improper neutralization of path traversal sequences when processing archive contents.
The restore code likely iterates over ZIP entries and writes each file using its stored path directly, without:
- Normalizing the path,
- Checking for
..segments, absolute paths, or drive specifiers, or - Verifying that the resolved path remains within a designated backup directory.
This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly called Zip Slip when it occurs in archive extraction routines.
Potential impact
- Overwrite of application configuration files, potentially altering security settings.
- Overwrite of application code or scripts, which can lead to remote code execution on the server.
- Overwrite of authentication-related files (tokens, keys, or session stores), enabling account or session hijacking.
- Disruption or denial of service by corrupting critical application or system files.
- Escalation from a lower-privileged web interface account to full system compromise, depending on filesystem layout and permissions.
General mitigation guidance
Effective mitigation focuses on constraining where and how files from archives are written:
- Treat all archive contents as untrusted input; never trust stored file paths.
- Normalize each ZIP entry path and enforce that its resolved target remains strictly within a predefined backup directory.
- Explicitly reject ZIP entries containing
.., absolute paths, or platform-specific drive prefixes. - Use high-level archive extraction utilities or libraries that support secure extraction callbacks or root-directory constraints.
- Run the application under a least-privilege OS account and restrict filesystem permissions so that even if extraction misbehaves, it cannot overwrite sensitive system or runtime files.
How teams detect issues like this
Detection can focus on both code-level signals and runtime behavior:
- Static analysis / code review:
- Search for custom ZIP or archive extraction loops that concatenate entry names directly into filesystem paths.
- Flag patterns where
zipfile(or equivalent library) entry names are written without normalization or boundary checks. - Review backup/restore, import/export, and file upload paths for directory traversal handling.
- Policy and tooling:
- Enforce secure extraction helpers or wrapper utilities via internal coding standards.
- Integrate SAST tools that have rules for Zip Slip (CWE-22 in archive extraction).
- Runtime monitoring:
- Monitor application processes for unexpected writes outside designated data directories.
- Use file integrity monitoring on sensitive configuration and code paths to detect unexpected overwrites.

