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

Improved: Improve validation method on service parameter (OFBIZ-13197) #869

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

nmalin
Copy link
Contributor

@nmalin nmalin commented Dec 30, 2024

Since the Remote Code Execution (File Upload) Vulnerability fixed by OFBIZ-11948, the class GroovyBaseScript.groovy contains a dependency with a service definition 'createAnonFile' to control the security.

This solution works but break the dependency between each component and the mandatory for a service to protect it himself.

Normally a service can secure each parameter with element type-validate unfortunately, this element can call only method with one parameter. In your case the method to validate a file upload need to have the delegator.

To solve it, we improve the element type-validate to analyze the method call for validate the attribute value and pass the delegator or dispatcher if it detected.

Like this we can move the code present on GroovyBaseScript to the service definition and offer the possibility to create more complex validate method for custom site.

Since the Remote Code Execution (File Upload) Vulnerability fixed by OFBIZ-11948, the class GroovyBaseScript.groovy contains a dependency with a service definition 'createAnonFile' to control the security.

This solution works but break the dependency between each component and the mandatory for a service to protect it himself.

Normally a service can secure each parameter with element type-validate unfortunately, this element can call only method with one parameter. In your case the method to validate a file upload need to have the delegator.

To solve it, we improve the element type-validate to analyze the method call for validate the attribute value and pass the delegator or dispatcher if it detected.

Like this we can move the code present on GroovyBaseScript to the service definition and offer the possibility to create more complex validate method for custom site.
@nmalin nmalin merged commit b8ab904 into apache:trunk Jan 6, 2025
7 checks passed
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