Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WW-5409 introduce final attribute to package element which make them unextendable #914

Conversation

jefferyxhy
Copy link
Contributor

WW-5409

 

Reason
Extending packages is a very useful capability of Struts but there are some quirks, that if a developer is not aware of, can lead to critical vulnerabilities. One such misunderstood quirk is the default-interceptor-ref element.

e.g. a parent package add permission interceptor for its action (say Action A), while child package extends parent package will inherit its actions but not interceptor. So if the develop is not aware of this, then Action A is now exposed with permission vuln through child package's namespace.

 

Changes/ Solution
introduce new final attribute on package element which will make it is unextendable

 

Result & Impact

  • By default, package final attribute is implied as false, so no difference.
  • Set package final attribute explicitly as true, will make this package unextendable, so any extends to this package will cause a ConfigurationException to be thrown during application struts config xml load step.

 

@jefferyxhy jefferyxhy marked this pull request as ready for review April 11, 2024 04:32
Copy link
Member

@lukaszlenart lukaszlenart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One concern about versioning DTDs

Copy link
Member

@lukaszlenart lukaszlenart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯

@kusalk kusalk merged commit 63267a8 into apache:master Apr 19, 2024
7 checks passed
@kusalk kusalk deleted the issue/WW-5409-introduce-final-attribute-to-package-element branch April 19, 2024 07:59
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.

3 participants