OPENNLP-1900: Document and publish the OpenNLP security model - #1198
Open
rzo1 wants to merge 2 commits into
Open
OPENNLP-1900: Document and publish the OpenNLP security model#1198rzo1 wants to merge 2 commits into
rzo1 wants to merge 2 commits into
Conversation
jzonthemtn
reviewed
Jul 28, 2026
jzonthemtn
reviewed
Jul 28, 2026
jzonthemtn
reviewed
Jul 28, 2026
jzonthemtn
reviewed
Jul 28, 2026
- Frame the trust bullets as guidance for the user's own mindset - Recommend explicitly against loading untrusted models - Correct the deserialization hardening claim: BaseModel installs an allowlist only, the graph depth/reference/array limits are SvmDoccatModel - Note that checksum verification happens at download time and cached models are not re-verified on subsequent loads
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a
SECURITY.mdat the repository root and links it fromREADME.md, sothe reporting instructions and the security model live in the same place — as the
ASF guidance
recommends.
This is a first draft and it is meant for discussion. I would rather argue
about the boundaries now, in a PR, than in a triage thread while a reporter waits.
Why now
We have no published security model. There is no
SECURITY.md, nothing inopennlp-docs, and the only written statement about input trust anywhere in thetree is a javadoc caveat on
SvmDoccatModel.deserialize()telling callers to usetrusted streams only.
That gap is getting expensive. The volume of AI-assisted vulnerability reports is
climbing across the ASF, and OpenNLP is an attractive target for them: we
deserialize several independent binary formats, so a model that has learned the
shape of one finding can generate the sibling for every other reader we ship.
Those reports are often technically accurate about the code and completely silent
on the question that actually decides the outcome — is this input attacker-
controlled? Without a written model, every one of them gets relitigated from
scratch, and we answer from memory, inconsistently.
Our own record is genuinely ambiguous on the central question:
SvmDoccatModel: accepted and fixed.BaseModeldeserialization hardened with anObjectInputFilter.MAX_ENTRIESbound applied toSymSpellModelSerializer.SvmDoccatModel's javadoc says the opposite: trusted streams only.In practice we behave as though models should be trusted and we harden the readers
anyway. That is a defensible position. It is just not written down anywhere, so it
cannot be cited, and a reporter has no way to know it before spending their time.
What it says
The framing that does most of the work: OpenNLP is a library and a set of CLI
tools. No sockets, no daemons, no accounts, no auth, no web UI. So the model
reduces almost entirely to input trust boundaries, and the whole class of
questions the ASF guidance asks about — admin roles, brute-force protection,
username enumeration — is simply not applicable.
Each input category gets an explicit trust level:
Plus sections on third-party dependencies (ONNX Runtime is native code we do not
sandbox), logging, seven pre-adjudicated known non-findings, and an explicit
invitation to send hardening reports that fall outside the guarantees.
Everything factual is taken from the code rather than assumed — the SHA-512
verification in
DownloadUtil, the secure-processing and no-DOCTYPE settings inXmlUtil, theObjectInputFilterallowlists inBaseModelandSvmDoccatModel,and the
MAX_ENTRIES/OPENNLP_MAX_ENTRIESbound inAbstractModelReader.Please push back on these specifically
welcome, CVE where impact warrants, citing both CVEs as precedent. This is the
escape hatch the ASF guidance explicitly offers. The alternative — models are
trusted, findings get fixed but never get a CVE — is defensible too, but it is
a deliberate choice and it means reconciling the
SvmDoccatModeljavadoc.Whatever we pick, the next report in this class should be answerable by citing
a paragraph.
commitment across every built-in regex in the tokenizers and normalizers. Do we
want to make it?
the tag history and the CVE-2026-42440 advisory. If there is a stated policy I
missed, this should match it.
opennlp-formatsare notwritten defensively. I think that is the right call for an offline operator
activity, but it is worth a second opinion.
Follow-up, not in this PR
The website is a separate repository, so
opennlp.apache.orgstill needs a linkto this once it lands.
Related: OPENNLP-1899 (branch
OPENNLP-1899) applies theMAX_ENTRIESbound toSymSpellModelSerializerand is the report that prompted this ticket.