Skip to content

Security: davils-com/kore

Security

SECURITY.md

Security Policy

Supported Versions

Security fixes are released for the latest minor version of the current major release.

Version Supported
3.2.x Yes
< 3.2 No

Reporting a Vulnerability

Do not open a public issue for a security problem.

Report it privately through GitHub's private vulnerability reporting, or by email to development@davils.com.

Please include:

  • the affected Kore version, module and JDK,
  • a description of the impact — what an attacker gains,
  • the steps to reproduce it, ideally as a minimal Kotlin snippet or test,
  • any mitigation you are already aware of.

We acknowledge a report within three working days and agree on a disclosure date with you.

Scope

Kore is a library: it runs with the privileges of the application that uses it. It treats everything it reads from outside the program as untrusted: command line arguments, environment variables, values of parameter sources, version strings, UUIDs, names, data sizes, encoded bytes, serialized documents, text, file paths, the attributes of principals and everything a library logs through kore-kheck.

The following are in scope:

  • input that makes Kore use unbounded memory or CPU, overflow, or crash with an unexpected exception,
  • untrusted text that reaches a message, a report, a toString or a usage text unescaped, so it can forge log lines or control a terminal,
  • a value declared as sensitive that appears anywhere outside the value itself,
  • a check that passes when it should refuse: an authorization helper of Principal, a path requirement, a version range or a converter that accepts what it documents as refused,
  • a weakness in the generation of UUIDs,
  • a NameRule, a decoder of decodeText or a serializer of kore-serialization that accepts what it documents as refused, or the process environment revealing a value through its toString,
  • a call of a Logger of kore-kheck whose logging throws, rather than the caller's own block, allocates although its level is disabled, or leaves out part of a record beyond its Limits without counting it in LogEvent.omitted, a logger name, field name, marker or value whose toString is not escaped, or a LogValue.Secret that reveals anything about the secret.

The following are not vulnerabilities in Kore:

  • a vulnerability in the JDK, the Kotlin standard library, kotlinx.coroutines or kotlinx-serialization — report those to the respective project,
  • an implementation of the Logger of kore-kheck, such as kheck, that writes a record unescaped or loses the count of omitted parts — report it to that implementation,
  • an application that passes a secret to a parameter it did not declare as sensitive, or logs a value it read,
  • the time between a path check of a converter and the moment the application opens the file; those checks are documented as advisory,
  • kore-testing on a production class path; its generators are deterministic by design.

Known Limitations

  • A format of kotlinx-serialization, such as Json, may put parts of its raw input into its own exceptions, before a serializer of Kore sees the text.
  • SingleFlight hands one caller's result to every caller of the same key; a key without the identity of the caller shares results across principals.
  • Kore has no type that holds a secret. A sensitive parameter returns its plain value; the application keeps it out of its own logs.
  • A UUID of version 7 reveals the time it was created and carries fewer random bits than one of version 4. Never use a UUID as a capability or a token.
  • @DavilsInternal is a compile-time opt-in, not an access boundary. Kotlin internal is public in JVM bytecode: Java code and reflection reach internal declarations through their mangled names. On the module path the module-info of kore-core exports only packages with public API, and implementation details live in packages it does not export; on the class path every class is reachable. Kore therefore validates in every constructor and keeps no secret in any field, internal ones included.
  • kore-kheck escapes what its own toString shows, but a record reaches a sink through an implementation of Logger, which escapes it there. LogEvent.cause keeps the throwable as it was given; its toString shows only the type, while an implementation decides what of its message and stack it writes. LoggerName.bounded shortens a name to MAX_NAME_LENGTH code units and may split a surrogate pair; the lone surrogate is escaped where it is shown. LoggerName.of and LoggerName.bounded shorten rather than refuse, so two names that share their first MAX_NAME_LENGTH code units become one name and their records merge into one logger, with one level; a name an attacker chooses that long can pose as another logger whose name is as long.
  • LogValue.Items and LogValue.Entries keep their hash code, but equals of two values built apart from each other whose parts are shared, the same list or group held many times over, can take time exponential in their depth, because equal parts are compared again wherever they occur. A built LogEvent is not affected: its values are bounded by Limits.MAX_VALUES, so comparing events stays bounded. Code should not compare standalone values without bounds, such as values built from input outside an event.
  • On Wasm the hash tables of Kotlin probe linearly, so keys that share one hash code, such as the strings Aa and BB and their concatenations, make a HashMap, a HashSet and every copy that hashes its keys, such as orderedCopy, slow down with the square of their number: 16,384 such keys took about 1.3 seconds where the JVM, whose tables turn long chains of comparable keys into trees, took 5 milliseconds. Where an attacker chooses many keys on Wasm, bound their number first or use OrderedMap, which compares keys instead of hashing them.
  • Escapes are written as \u{XXXX}, \n, \r and \t. A literal backslash in free text is shown as it is, so input can display text that looks like an escape, but never a real control character. Right-to-left letters are shown as they are; a viewer may reorder the neutral characters around them.

Verifying a Release

Releases are published to https://repo.davils.com/releases and signed with the release key of Davils; its fingerprint is published in this section with the first release, so a consumer can pin it as a trusted-key in its own gradle/verification-metadata.xml. A release also carries a signed build provenance attestation made by the GitHub Actions run that built it:

gh attestation verify kore-core-jvm-2.5.2.jar --repo davils-com/kore --signer-repo davils-com/kotlin-workflow

Snapshots in https://repo.davils.com/snapshots are neither signed nor attested and are not meant for production.

There aren't any published security advisories