You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Proton VPN credentials write unescaped raw newlines into keyring secrets, corrupting GNOME Keyring files #33
When protonvpn stores authentication credentials (such as Password for 'proton-sso-account-...' on 'Proton'), it serializes a JSON payload containing PEM certificates (-----BEGIN PUBLIC KEY-----, -----BEGIN CERTIFICATE-----) with raw literal newline characters inside the secret string rather than escaping them as \n.
In GNOME Keyring file-based storage (~/.local/share/keyrings/*.keyring), entries in passwordless keyrings are stored in standard INI format (key=value), where values must be strictly single-line. Because literal unescaped newlines are written into secret=, the .keyring file becomes malformed across multiple physical lines.
Consequence
On subsequent system boot or session login, gnome-keyring-daemon (tested on 1:51.1-1) fails to parse the file:
gnome-keyring-daemon: keyring was in an invalid or unrecognized format: ~/.local/share/keyrings/Default_keyring.keyring
When this occurs:
gnome-keyring-daemon drops the entire keyring as unparseable.
The system prompts the user with desktop authentication dialogs (e.g., "Authentication required: The login keyring did not get unlocked").
All other application credentials stored in the same keyring become inaccessible.
Malformed Content Example (Sanitized)
[13]item-type=0
display-name=Password for 'proton-sso-account-xxx' on 'Proton'secret={"UID": "xxx", "certificate": {"ClientKey": "-----BEGIN PUBLIC KEY-----MCowBQYDK2VwAyEAMHEP/L4WUx/V43288cAdq7Dfjyds8HF+KiBcGX79Xmo=-----END PUBLIC KEY-----", "Certificate": "-----BEGIN CERTIFICATE-----MIIB9zCCAamgAwIBAgIFBBKPaOcwBQYDK2VwMDEx......-----END CERTIFICATE-----", "ExpirationTime": 1792305663, ...}}
mtime=1791811165
ctime=1791635757
Verification & Workaround
Replacing the physical raw newlines in the secret= JSON string with escaped \n characters (collapsing the field into a single line) immediately resolves the parsing failure: gnome-keyring-daemon 1:51.1-1 parses and unlocks the keyring with zero errors.
Proposed Fix
Ensure that serialized JSON strings or certificates containing newlines are sanitized / escaped as single-line strings before writing to the secret storage backend.
Second independent reproduction, with measurements (Omarchy 4.0.5-1, gnome-keyring 1:51.1-1, proton-vpn-cli 1.0.5-1, python-proton-keyring-linux 0.2.3-1 — 2026-10-18). Everything above checks out against an instrumented case.
On a passwordless (plaintext INI) default keyring, the secret stored as Password for 'proton-sso-account-…' measured 2,485 bytes unfolding across 17 physical secret= lines in ~/.local/share/keyrings/Default.keyring. From the first such store onward, gnome-keyring-daemon rejected the entire file at the next start:
gnome-keyring-daemon: keyring was in an invalid or unrecognized format: …/Default.keyring
then dropped the whole collection, not just the Proton item. Everything keyed off it became unreachable at once — Chromium Safe Storage (Chromium silently rotated to a fresh key, so every browser session was lost), gh tokens, mail credentials. Under SDDM autologin there is no PAM password available to unlock or repair anything, so each login ended in a "create a new keyring" prompt.
Worth keeping the two halves of this bug distinct when routing it:
Trigger (this repo): the credential payload embeds PEM material (-----BEGIN PUBLIC KEY----- / -----BEGIN CERTIFICATE-----) as literal raw newlines. Escaping them, or base64-wrapping the PEM blobs before serialization, would remove the trigger even on unpatched gnome-keyring.
Two details from the repair work that may help others debugging this:
Only interior newlines corrupt the file. A trailing newline self-heals on the next rewrite (GLib tolerates the resulting blank line), which is why seemingly similar entries behave differently.
Full-data repair: fold each multi-line secret= back onto one physical line, escaping \ as \\ and each newline as \n — byte-identical to what the fixed writer produces. g_key_file_get_string() then restores the exact original value and the app keeps working. Verified on 51.1: file parses, all items load, unlock is silent, no errors across reboots.
Resolution on our machine: deleted the two Proton items and uninstalled proton-vpn-cli entirely — no recurrence since. A fix on the proton side would be genuinely valuable given how reliably this payload wedges the keyring.
Activity
jparlay commentedon Oct 18, 2026
Second independent reproduction, with measurements (Omarchy 4.0.5-1,
gnome-keyring 1:51.1-1,proton-vpn-cli1.0.5-1,python-proton-keyring-linux0.2.3-1 — 2026-10-18). Everything above checks out against an instrumented case.On a passwordless (plaintext INI) default keyring, the secret stored as
Password for 'proton-sso-account-…'measured 2,485 bytes unfolding across 17 physicalsecret=lines in~/.local/share/keyrings/Default.keyring. From the first such store onward,gnome-keyring-daemonrejected the entire file at the next start:then dropped the whole collection, not just the Proton item. Everything keyed off it became unreachable at once — Chromium Safe Storage (Chromium silently rotated to a fresh key, so every browser session was lost),
ghtokens, mail credentials. Under SDDM autologin there is no PAM password available to unlock or repair anything, so each login ended in a "create a new keyring" prompt.Worth keeping the two halves of this bug distinct when routing it:
-----BEGIN PUBLIC KEY-----/-----BEGIN CERTIFICATE-----) as literal raw newlines. Escaping them, or base64-wrapping the PEM blobs before serialization, would remove the trigger even on unpatched gnome-keyring.g_key_file_set_value()(newlines left unescaped) but reads them back withg_key_file_get_string(). Upstream: GNOME/gnome-keyring#103, fix MR GNOME/gnome-keyring!111 (still open). Omarchy packaging PR: gnome-keyring: escape multiline secrets in textual keyrings omacom/omarchy-pkgs#248. The large cluster of desktop reports is tracked in Update/reboot left keyring in invalid state, browser sessions and gh auth got cleared omacom/omarchy#5105.Two details from the repair work that may help others debugging this:
secret=back onto one physical line, escaping\as\\and each newline as\n— byte-identical to what the fixed writer produces.g_key_file_get_string()then restores the exact original value and the app keeps working. Verified on 51.1: file parses, all items load, unlock is silent, no errors across reboots.Resolution on our machine: deleted the two Proton items and uninstalled
proton-vpn-clientirely — no recurrence since. A fix on the proton side would be genuinely valuable given how reliably this payload wedges the keyring.