Summary
Wavelog's QSL handling can allow an authenticated user to store a filename containing path components and later cause the PHP worker to delete a file outside the intended QSL image directory. The risk arises when the user can associate that filename with a QSO they own and the worker has permission to delete the targeted file.
Affected context
The issue is in Wavelog's QSL handling flow: addQsoToQsl() stores a submitted filename, and deleteQsl() later passes the associated value to unlink(). It may affect deployments where filename values are not constrained to the QSL image directory and the PHP worker can write to files elsewhere on the system. Deleting installer gate files may also expose the installer again, with further consequences depending on deployment configuration.
Exploit preconditions
- Attack surface: Authenticated web requests to the QSL add and delete endpoints.
- Required access: A standard authenticated user able to associate a filename with a QSO they own.
- Trigger point: Deletion of the QSL record whose stored filename is used by
unlink(). - Why exploitation is possible: The filename is not adequately restricted to the per-user image directory, so path components may direct deletion outside that directory; the target must also be writable or deletable by the PHP worker.
Why this happens
The application accepts an externally influenced filename and uses it as a filesystem path without ensuring that it remains within the intended directory. Relative path components can therefore escape that directory, which maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). The externally controlled filename also relates to CWE-73: External Control of File Name or Path.
Potential impact
- The attacker may delete files writable by the PHP worker, potentially disrupting application operations.
- Deletion of configuration or operational files could cause denial of service or impair recovery.
- If installer gate files are removed, the installer could become accessible again.
- Reopened installer access could, depending on the deployment, enable application identity takeover through attacker-controlled database configuration.
General mitigation guidance
Defensive approaches focus on ensuring user-controlled filenames cannot select filesystem paths.
- Prefer server-generated file identifiers over accepting path-bearing filenames.
- Apply strict allowlists to filename formats and reject separators and relative path components.
- Resolve paths and verify they remain within the intended directory before filesystem operations.
- Keep file operations scoped to dedicated storage directories and use least-privilege worker permissions.
- Reduce trust in mutable request and database values, and protect installer controls and operational files from runtime modification.
How teams detect issues like this
- Use static analysis to identify filesystem deletion calls that receive values derived from requests or database fields.
- Review code paths that store filenames separately from the code paths that later use them in filesystem operations.
- Check that path normalization and directory-boundary validation occur before deletion.
- Enforce code-review or CI policies that prohibit untrusted values from reaching filesystem APIs without validation.
- Monitor for unexpected deletion attempts outside designated upload or image directories.

