Skip to content

[FIX] Prevent Hessian2 serializable security bypass via writeReplace (#16287)#16288

Open
LI123456mo wants to merge 1 commit into
apache:3.3from
LI123456mo:fix-hessian-writereplace-security-bypass
Open

[FIX] Prevent Hessian2 serializable security bypass via writeReplace (#16287)#16288
LI123456mo wants to merge 1 commit into
apache:3.3from
LI123456mo:fix-hessian-writereplace-security-bypass

Conversation

@LI123456mo
Copy link
Copy Markdown
Contributor

Description

This PR resolves a validation bypass during Hessian2 serialization where classes utilizing a custom writeReplace() method could inadvertently circumvent security filters.

Core Changes

  • Enforce Validation: Updated Hessian2SerializerFactory to ensure that classes implementing writeReplace() are rigorously checked against the DefaultSerializeClassChecker allowlist and standard serializable structure validations.
  • Security Alignment: Prevents unauthorized objects from slipping past the framework's serialization guardrails via custom substitution methods.

Related Issue

Fixes #16287

Checklist

  • Code formatted locally via mvn spotless:apply.
  • Clear and concise commit messages maintained.

@LI123456mo LI123456mo force-pushed the fix-hessian-writereplace-security-bypass branch 2 times, most recently from 183844d to 239a370 Compare May 24, 2026 03:17
@LI123456mo LI123456mo force-pushed the fix-hessian-writereplace-security-bypass branch from 239a370 to 9062be7 Compare May 26, 2026 16:49
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.

Classes with writeReplace() bypass Hessian2 Serializable security check

1 participant