Skip to content

Add SECURITY.md - #781

Open
leerho wants to merge 2 commits into
mainfrom
security-md
Open

leerho wants to merge 2 commits into
mainfrom
security-md

Conversation

@leerho

@leerho leerho commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Adds a SECURITY.md, adapted from the one in datasketches-cpp (apache/datasketches-cpp#545), so both libraries make the same commitments.

It covers:

  • Reporting: report privately to security@apache.org or private@datasketches.apache.org, not through public issues or PRs.
  • Supported versions and published vulnerabilities: same text as C++.
  • Security model:
    • Deserialization is in scope. heapify(), wrap(), writableWrap(), getInstance() and deserialize() must be safe on arbitrary input. Malformed input must be rejected with a RuntimeException: usually a SketchesArgumentException, but standard Java runtime exceptions are also acceptable. Throwing an Error (such as OutOfMemoryError) is not.
    • Java-specific definition of a vulnerability. Java checks array and segment bounds, so the C++ wording (out-of-bounds reads and writes, undefined behavior) doesn't apply. Instead, deserializing must not:
      • loop forever;
      • allocate memory based on declared sizes that are inconsistent with the rest of the input or exceed the sketch type's documented limits;
      • return a sketch that later hangs or exhausts memory. (A sketch that later throws a runtime exception is an ordinary bug, not a vulnerability.)
    • Oversized caller segments are supported. A caller-provided MemorySegment larger than the sketch needs, so a direct sketch can grow in place, is allowed. Bytes beyond the serialized image must not be trusted.
    • Item serializers: an ArrayOfItemsSerDe written by the application is the application's responsibility.
    • Out of scope: misuse of other APIs, and adversarial bias of estimates (same as C++).

Documentation only; no code changes.

🤖 Generated with Claude Code

Describes how to report vulnerabilities privately and the security
model, adapted from datasketches-cpp for Java: deserialization of
arbitrary input must be rejected with a SketchesException and must not
hang, allocate based on inconsistent or out-of-limit declared sizes, or
return a sketch that fails later. A caller-provided MemorySegment larger
than the sketch needs is supported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leerho
leerho requested review from proost and tisonkun October 25, 2026 19:56
…lure rule

Malformed input may be rejected with any RuntimeException, not only a
SketchesException, since standard Java exceptions are often more
descriptive. Throwing an Error is not acceptable. A sketch that accepts
a corrupt image is a vulnerability only if a later operation hangs or
exhausts memory; a later runtime exception is an ordinary bug.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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