Rapid7 Vulnerability & Exploit Database

JSON Swagger CodeGen Parameter Injector

Back to Search

JSON Swagger CodeGen Parameter Injector



This module generates an Open API Specification 2.0 (Swagger) compliant json document that includes payload insertion points in parameters. In order for the payload to be executed, an attacker must convince someone to generate code from a specially modified swagger.json file within a vulnerable swagger-codgen appliance/container/api/service, and then to execute that generated code (or include it into software which will later be executed by another victim). By doing so, an attacker can execute arbitrary code as the victim user. The same vulnerability exists in the YAML format.


  • ethersnowman <scott_davis@rapid7.com>




nodejs, php, java, ruby


Module Options

To display the available options, load the module within the Metasploit console and run the commands 'show options' or 'show advanced':

msf > use exploit/multi/fileformat/swagger_param_inject
msf exploit(swagger_param_inject) > show targets
msf exploit(swagger_param_inject) > set TARGET < target-id >
msf exploit(swagger_param_inject) > show options
    ...show and set options...
msf exploit(swagger_param_inject) > exploit

Time is precious, so I don’t want to do something manually that I can automate. Leveraging the Metasploit Framework when automating any task keeps us from having to re-create the wheel as we can use the existing libraries and focus our efforts where it matters.

– Jim O’Gorman | President, Offensive Security