8000 Implement OpenPGP message grammar validation (add `config.enforceGrammar`) by larabr · Pull Request #1853 · openpgpjs/openpgpjs · GitHub
[go: up one dir, main page]

Skip to content

Conversation

larabr
Copy link
Collaborator
@larabr larabr commented May 16, 2025

With this change, the lib enforces a message structure as defined in https://www.rfc-editor.org/rfc/rfc9580.html#section-10.3, but slightly more permissive with Padding packets allowed in all cases, and standalone encrypted session key packets (ESK) also permitted.
Since we are unclear on whether this change might impact handling of some messages in the wild, generated by
odd use-cases or non-conformant implementations, we also add the option to disable the grammar check via
config.enforceGrammar (on by default).

larabr added 3 commits May 16, 2025 15:26
To access the types in internally.

Also, include internal d.ts files in published npm bundle.
…mar`)

It enforces a message structure as defined in
https://www.rfc-editor.org/rfc/rfc9580.html#section-10.3
(but slightly more permissive with Padding packets allowed in all cases).
Since we are unclear on whether this change might
impact handling of some messages in the wild, generated by
odd use-cases or non-conformant implementations, we
also add the option to disable the grammar check via
`config.enforceGrammar`.

GrammarErrors are only sensitive in the context of
unauthenticated decrypted streams.
@twiss twiss merged commit 88cd181 into openpgpjs:main May 20, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0