Skip to content
dpapi-config: Windows DPAPI library encrypts secrets in JSON config files

dpapi-config: Windows DPAPI library encrypts secrets in JSON config files

First seen 26 Nov 2026, 17:50 UTC • •

Article Content

Browse articles
ThreatCluster AI
ThreatCluster •November 26, 2026 at 17:51 UTC
  • •dpapi-config encrypts only listed string secrets in JSON config files using Windows DPAPI, with no master password or key file.
  • •The package raises CredentialError instead of writing plaintext when DPAPI is unavailable, according to the project description.
  • •Encryption functions are Windows-only; the read path still works on plaintext files.
  • •Migration of plaintext files is one-way and older builds will read migrated secrets as missing.
  • •The package does not tighten file ACLs, so users must apply icacls or SetFileSecurity for shared locations.

A Python package named dpapi-config, published on PyPI and GitHub, encrypts selected string fields in JSON configuration files using Windows DPAPI. DPAPI derives the key from the logged-in Windows account, so no master password or key file is required.

Encrypted fields are replaced with a "dpapi:" envelope, leaving the file a valid JSON document. The package is described as failing closed: if DPAPI is unavailable, encryption functions raise CredentialError rather than writing plaintext. Encryption is Windows-only; the read path still works on plaintext files.

Migration of existing plaintext files occurs only when load() is called with migrate=True, and the migration is one-way. The package does not tighten file ACLs, does not support a keychain backend, does not encrypt non-string values, and does not traverse lists.

The sources describe a fix to an earlier version that returned plaintext on DPAPI failure. The articles are a PyPI listing and two GitHub pages with identical text; no vulnerability, attack, or exploitation is reported.

Start a free Starter trial for enhanced analysis

Ask AI about this cluster

Or ask in your own assistant: ClaudeChatGPTPerplexityGemini

More articles in this cluster (4)

Common questions

Does this package expose a vulnerability?
No. The sources describe a software library and mention no vulnerability, CVE, or exploitation.
Am I affected if I use plaintext configs?
The project describes its own migration path, which requires calling load() with migrate=True on Windows; the sources do not describe any impact on other users.
What should a Windows admin do with shared config files?
The project states it does not tighten ACLs, so administrators should restrict file permissions themselves with icacls or SetFileSecurity.