Skip to content

Harden XML parsing, serialization, and randomness#3075

Open
CydeWeys wants to merge 2 commits into
google:masterfrom
CydeWeys:security-audit
Open

Harden XML parsing, serialization, and randomness#3075
CydeWeys wants to merge 2 commits into
google:masterfrom
CydeWeys:security-audit

Conversation

@CydeWeys
Copy link
Copy Markdown
Member

@CydeWeys CydeWeys commented May 29, 2026

This commit introduces several security hardening improvements across the codebase:

  1. XML Processing: Hardened TransformerFactory and SchemaFactory instantiations in EppMessage.java by explicitly enabling XMLConstants.FEATURE_SECURE_PROCESSING and disabling external schema access.
  2. Randomness: Replaced instances of java.util.Random with java.security.SecureRandom in SelfSignedCaCertificate.java for stronger entropy. (Added documentation in ProxyModule.java explaining why java.util.Random is intentionally retained there for metrics sampling).
  3. Deserialization: Hardened SerializeUtils.java by injecting an ObjectInputFilter into the ObjectInputStream, restricting deserialization strictly to expected google.registry classes and standard Java collections.

This change is Reviewable

This commit introduces several security hardening improvements across the codebase:
1. XML Processing: Hardened `TransformerFactory` and `SchemaFactory` instantiations in `EppMessage.java` by explicitly enabling `XMLConstants.FEATURE_SECURE_PROCESSING` and disabling external schema access.
2. Randomness: Replaced instances of `java.util.Random` with `java.security.SecureRandom` in `SelfSignedCaCertificate.java` for stronger entropy. (Added documentation in `ProxyModule.java` explaining why `java.util.Random` is intentionally retained there for metrics sampling).
3. Deserialization: Hardened `SerializeUtils.java` by injecting an `ObjectInputFilter` into the `ObjectInputStream`, restricting deserialization strictly to expected `google.registry` classes and standard Java collections.
@CydeWeys CydeWeys requested a review from gbrodman May 29, 2026 20:47
@CydeWeys CydeWeys enabled auto-merge May 29, 2026 20:47
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