Skip to content

Publish as org.owasp:java-html-sanitizer with relocation and SHA-512 signatures - #540

Draft
jmanico wants to merge 1 commit into
mainfrom
move-to-org-owasp-coordinates
Draft

jmanico wants to merge 1 commit into
mainfrom
move-to-org-owasp-coordinates

Conversation

@jmanico

@jmanico jmanico commented Nov 8, 2026

Copy link
Copy Markdown
Member

Summary

Implements #531: future releases publish as org.owasp:java-html-sanitizer, signed only with the project release key F6109A4F3F5616E1A7A62099E02DB03BAF6C438C.

Draft until Sonatype adds com.googlecode.owasp-java-html-sanitizer to the OWASP Central organization. Every release now stages a relocation POM there, so until that access exists the Central Portal would reject the whole deployment. Nothing would be partially published.

Coordinates

  • Library: org.owasp:java-html-sanitizer. Parent: org.owasp:java-html-sanitizer-parent. The shims, examples and empiricism modules get the same java-html-sanitizer- prefix; they stay unpublished.
  • New legacy-relocation/ module publishes, with each release, a POM-only com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:<version>. It relocates to org.owasp:java-html-sanitizer, with no dependencies and no pinned target version. Existing releases at the old coordinates are untouched.
  • Unchanged: the org.owasp.html package, the JPMS module owasp.java.html.sanitizer, Java 8 bytecode, and the version scheme. Bundle-SymbolicName is now pinned to com.googlecode.owasp-java-html-sanitizer, because bnd would otherwise derive a new name from the coordinates. The packaging verification checks this.
  • The shade exclude now names the shim metadata directories in full. The old pattern java*/** under org.owasp would also have stripped the library's own pom.properties, which scanners use to identify the JAR.

Signing

  • JReleaser's built-in signer hard-codes SHA-1, both in 1.26.0 and in the latest 1.27.0. The 20261107.1 and 20260921.1 signatures on Central use SHA-1. Signing now runs gpg in command mode with --digest-algo SHA512.
  • scripts/with-release-key.sh puts only the pinned release key in a temporary keyring for JReleaser.
  • scripts/verify-artifact-signatures.sh rejects digests weaker than SHA-256 and prints gpg's status on failure.

Release safety

  • scripts/check-staged-release.sh runs after the build and before tagging. It requires that staging holds exactly the library jar, sources, javadoc and POM, the parent POM, and the relocation POM. It also checks the relocation target, the JAR's own Maven metadata, the absence of shim metadata, and the OSGi name.
  • A failed staging check reverts the release commit, as a build failure does. Both happen before anything is published.

Validation (local, Homebrew JDKs)

  • ./mvnw clean verify on JDK 11, 17, 21 and 25: 761 + 7 tests pass on each, including the JPMS and Java 8 consumer checks.

  • Publication build at placeholder version 20000101.0 produces exactly the six expected components, and check-staged-release.sh passes.

  • JReleaser deploy in dry-run mode with a throwaway key:

    • all six files signed through gpg with SHA-512 (digest algo 10)
    • JReleaser's POM checks accept the relocation POM
    • the verifier passes
  • Negative cases fail as intended:

    • the verifier rejects a SHA-1 signature
    • the wrapper rejects a key that doesn't match the pinned fingerprint
    • the staging check rejects an extra artifact
  • Maven 3.9 resolution against the staged repository:

    Case Result
    new coordinates only one jar
    old coordinates at the relocated version resolves to the new jar
    both coordinates at the new version one jar
    old real release (20261107.1) arriving transitively + new two jars, the known risk
    same, old coordinates managed to the relocated version one jar
    same, old coordinates excluded one jar
  • ShellCheck, actionlint, YAML parse and git diff --check pass.

Not in this PR

  • User-facing docs (docs/maven.md migration guide, README badge, javadoc.io links, SECURITY.md, docs/vulnerabilities.md). Changing them before the first org.owasp release would point readers at coordinates that don't exist yet, so that will be a follow-up merged just before the release. The relocation message points to docs/maven.md.
  • Gradle resolution, Maven 4, and an OSGi container upgrade test.
  • A new Central publishing token from the OWASP organization, once Sonatype grants access.

🤖 Generated with Claude Code

…signatures

Move the reactor to org.owasp coordinates (issue #531): the library is
org.owasp:java-html-sanitizer, its parent java-html-sanitizer-parent,
and the unpublished modules get the same prefix.  A new
legacy-relocation module publishes, with each release, a POM-only
relocation at com.googlecode.owasp-java-html-sanitizer:
owasp-java-html-sanitizer that points to the same version under the new
coordinates.  Java packages, the JPMS module name and, now pinned, the
OSGi bundle symbolic name are unchanged.  The shade exclude names the
shim metadata directories in full, since java*/** under org.owasp would
also strip the library's own pom.properties.

JReleaser's built-in signer hashes with SHA-1, so sign with gpg in
command mode with SHA-512 instead.  scripts/with-release-key.sh puts the
pinned release key alone in a temporary keyring for it.  The release and
the no-publish check now verify the staging repository holds exactly the
expected components before anything is tagged or uploaded, and the
signature check rejects digests weaker than SHA-256.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant