Skip to content

Update StructuredDataMessage Javadoc for RFC 5424 compliance#4103

Open
DrDrunkenstien-10 wants to merge 1 commit intoapache:2.xfrom
DrDrunkenstien-10:improve/structured-data-message-javadoc-rfc5424
Open

Update StructuredDataMessage Javadoc for RFC 5424 compliance#4103
DrDrunkenstien-10 wants to merge 1 commit intoapache:2.xfrom
DrDrunkenstien-10:improve/structured-data-message-javadoc-rfc5424

Conversation

@DrDrunkenstien-10
Copy link
Copy Markdown

Fixes #4051

This pull request improves the Javadoc of StructuredDataMessage constructors by clarifying
the expected format and usage of the id (SD-ID) and type (MSGID) parameters.

Specifically:

  • Adds references to RFC 5424 sections for SD-ID and MSGID
  • Documents that these parameters are expected to conform to the RFC syntax
  • Clarifies that they are treated as trusted inputs (typically compile-time constants)
  • Highlights that validation/sanitization is the caller's responsibility when using untrusted input
  • Recommends using StructuredDataId instead of raw String where applicable

This change is documentation-only and does not modify runtime behavior.

This improvement is based on feedback from the YesWeHack bug bounty report (#YWH-PGM10209-37),
which identified a lack of clarity in the existing documentation.

Checklist

  • Base your changes on 2.x branch if you are targeting Log4j 2; use main otherwise

    • Yes (based on 2.x)
  • ./mvnw verify succeeds (the build instructions)

    • Yes
  • Non-trivial changes contain an entry file in the src/changelog/.2.x.x directory

    • Not applicable (documentation-only change; no behavioral impact)
  • Tests are provided

    • Not applicable (documentation-only change)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Document StructuredDataMessage argument constraints

1 participant