CVE-2026-23893
Symlink Following Vulnerability in openCryptoki Enables Privilege Escalation
Publication date: 2026-01-22
Last updated on: 2026-03-06
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| opencryptoki_project | opencryptoki | From 2.3.2 (inc) |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-59 | The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability in openCryptoki (versions 2.3.2 and above) involves symlink-following issues in privileged contexts. Token-group users can create symbolic links (symlinks) in group-writable token directories. When administrative tools or the base code run with elevated privileges (such as root) and perform file operations like changing ownership or permissions, they may follow these symlinks unintentionally. This allows attackers to redirect file operations to arbitrary filesystem targets, potentially modifying or exposing sensitive files. The root cause is that functions like fopen() and stat() follow symlinks instead of safely handling them, enabling privilege escalation or data exposure. The issue was fixed by introducing safer file opening methods that do not follow symlinks and by replacing stat() with lstat() to detect symlinks properly. [1, 2]
How can this vulnerability impact me? :
If exploited, this vulnerability can allow a token-group user to escalate their privileges or expose sensitive data by redirecting file operations to arbitrary files on the system. For example, an attacker could cause administrative tools running as root to change ownership or permissions on critical system files like /etc/shadow or /etc/passwd. This can lead to unauthorized read/write access, modification of system configuration files, and overall compromise of system security. Exploitation requires token-group membership and an administrator running maintenance tools that perform file ownership or permission changes. [2]
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability can be detected by checking for the presence of symlinks planted by token-group users inside group-writable token directories (permissions 0770). You can inspect these directories for symbolic links using commands like `find /path/to/token/directories -type l -ls` to list symlinks. Additionally, monitoring logs for messages such as "Refusing to follow symlink" can indicate attempts to exploit this issue. Since the vulnerability involves symlink-following during file operations, verifying if administrative tools or applications are following symlinks can be done by auditing file access patterns or using tools like `lsof` to check open files and their targets. However, no specific detection commands are provided in the resources. [1, 2]
What immediate steps should I take to mitigate this vulnerability?
Immediate mitigation steps include restricting token-group membership to trusted users only, as the vulnerability requires token-group membership to exploit. Avoid running openCryptoki administrative tools or PKCS#11 applications that perform ownership or permission changes on token directories until a patched version including commit 5e6e4b42f2b1fcc1e4ef1b920e463bfa55da8b45 is deployed. Administrators should carefully audit and monitor token directories for unauthorized symlinks and remove any suspicious symlinks found. Applying the fix from the referenced commit, which replaces vulnerable file operations with safer ones that do not follow symlinks (using `fopen_nofollow()` and replacing `stat()` with `lstat()`), is the definitive solution once available in a release. [1, 2]
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
This vulnerability can lead to unauthorized data exposure and privilege escalation by allowing token-group users to manipulate symlinks that cause administrative tools running as root to modify unintended files, including sensitive system files. Such unauthorized access and modification of sensitive data could result in non-compliance with data protection standards and regulations like GDPR and HIPAA, which require strict controls on access to sensitive information and protection against unauthorized data disclosure or alteration. [2]