PEM
A common encoding format for keys and certificates, in which base64-encoded body content is wrapped by BEGIN and END boundary lines, with a label identifying the block type.
Timeline (last 90 days)
In implementations before version 0.7.9, llm-stream-guardrails held PEM private keys via the `BEGIN PRIVATE KEY` marker, but determined the end by whether any labeled `END` line appeared, rather than requiring the label to match exactly.
Due to the flawed end-marker matching logic, when a PEM private key's end marker was mistakenly written as `END CERTIFICATE`, the library masked only the header, and the base64-encoded private key body streamed through directly in plaintext, with the leaked body able to reconstruct a usable private key.
The PEM format wraps a base64-encoded body between two boundary lines, `-----BEGIN <label>-----` and `-----END <label>-----`, with the label identifying the block type; strict parsers reject blocks whose begin and end labels mismatch, while lenient parsers may consider a block closed merely upon the appearance of END.
Safely parsing PEM must bind the begin label to the end label rather than relying on any END line.
All Facts (4)
In implementations before version 0.7.9, llm-stream-guardrails held PEM private keys via the `BEGIN PRIVATE KEY` marker, but determined the end by whether any labeled `END` line appeared, rather than requiring the label to match exactly.
50%UnverifiedDue to the flawed end-marker matching logic, when a PEM private key's end marker was mistakenly written as `END CERTIFICATE`, the library masked only the header, and the base64-encoded private key body streamed through directly in plaintext, with the leaked body able to reconstruct a usable private key.
50%UnverifiedThe PEM format wraps a base64-encoded body between two boundary lines, `-----BEGIN <label>-----` and `-----END <label>-----`, with the label identifying the block type; strict parsers reject blocks whose begin and end labels mismatch, while lenient parsers may consider a block closed merely upon the appearance of END.
50%UnverifiedSafely parsing PEM must bind the begin label to the end label rather than relying on any END line.
50%