ZCode open-source release reveals credential security flaw in default key generation

ZCode open-source release reveals credential security flaw in default key generation

N
News Editor
2026-09-21 07:07:09
A new security issue has surfaced after ZCode was open-sourced. Developers reviewing the code found that ZCode stores login credentials locally in encrypted form, but under the default setup, the decryption key can be derived directly from the operating system, username, and user directory. Those inputs are typically not hard to obtain. If an attacker gets access to the local credential file, the public source code would allow them to recreate the key without breaking the encryption algorithm itself. The finding also appears to conflict with ZCode’s documentation, which says the credentials are encrypted on a per-device basis and cannot be decrypted after switching machines. In the open-source default implementation, however, there is no use of a device ID or hardware-based information. That said, the issue is not described as a remote vulnerability. An attacker must first obtain the local credential file. Users who manually set ZCODE_CREDENTIAL_SECRET are also not affected by the default key path. If the file is exposed, login sessions for ZCode, Z.ai, or BigModel could be restored and then abused, including possible use of Coding Plan quotas, but the issue would not let an attacker compromise the computer itself.

A security issue has emerged in ZCode after the project was open-sourced. Developers examining the code found that ZCode stores user login credentials locally in encrypted form, but under the default configuration, the decryption key can be derived from the operating system, username, and user directory. Those details are usually not difficult to obtain.

That means an attacker who gets hold of the credential file saved by ZCode could recreate the key by following the public source code, without having to break the encryption algorithm.

ZCode’s official documentation says these login credentials are "encrypted per device and cannot be decrypted after switching machines." But the default scheme shown in the open-source code does not use a device ID or hardware information. The documentation and the code do not match on that point.

Still, this is not a vulnerability that allows credentials to be stolen remotely out of thin air. An attacker would first need access to the local credential file. Users who have manually set ZCODE_CREDENTIAL_SECRET would not use the default key path described above.

If the file is leaked, login sessions for ZCode, Z.ai, or BigModel could potentially be restored, which could lead to account misuse or consumption of Coding Plan quotas. It would not, however, result in the computer itself being compromised.

This article was originally published by Bit.Fan. For more cryptocurrency news and market insights, visit www.bit.fan.
11600

Disclaimer:

The market information, project data, and third-party content displayed on this platform are for industry information sharing only and do not constitute any form of investment advice or return commitment.

Cryptocurrency trading carries high risks. Users should fully assess their risk tolerance and make independent decisions. All profits, losses, and legal responsibilities are borne by the users themselves.