CVE-2026-23893
Unknown Unknown - Not Provided
Symlink Following Vulnerability in openCryptoki Enables Privilege Escalation

Publication date: 2026-01-22

Last updated on: 2026-03-06

Assigner: GitHub, Inc.

Description
openCryptoki is a PKCS#11 library and provides tooling for Linux and AIX. Versions 2.3.2 and above are vulnerable to symlink-following when running in privileged contexts. A token-group user can redirect file operations to arbitrary filesystem targets by planting symlinks in group-writable token directories, resulting in privilege escalation or data exposure. Token and lock directories are 0770 (group-writable for token users), so any token-group member can plant files and symlinks inside them. When run as root, the base code handling token directory file access, as well as several openCryptoki tools used for administrative purposes, may reset ownership or permissions on existing files inside the token directories. An attacker with token-group membership can exploit the system when an administrator runs a PKCS#11 application or administrative tool that performs chown on files inside the token directory during normal maintenance. This issue is fixed in commit 5e6e4b4, but has not been included in a released version at the time of publication.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-01-22
Last Modified
2026-03-06
Generated
2026-05-27
AI Q&A
2026-01-22
EPSS Evaluated
2026-05-25
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
opencryptoki_project opencryptoki From 2.3.2 (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
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]


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart