{"id":"CVE-2013-7379","aliases":[],"url":"https://o3.security/vulnerability/CVE-2013-7379","summary":"API Admin Auth Weakness in tomato","details":"Versions of `tomato` prior to 0.0.6 are affected by a somewhat complex authentication bypass vulnerability in the admin service when only a single access key is configured on the server. The vulnerability allows an attacker to guess the password for the admin service, no matter how complex that password is, in less than 200 requests.\n\n\n## Details\nThe tomato API has an admin service that is enabled by setting up an `access_key` in the config options. This `access_key` is intended to protect the API admin from unauthorized access.\n\n\nTomato verifies the `access_key` by checking to see if the server `access_key` incorporates the user provided value at any location. This allows an attacker to provide a single character as an `access_key`, and so long as the server key contains at least one instance of that character it will be considered a valid key.\n\n## Proof of Concept\nThis is the snippet of code that does the comparison to authorize requests.\n\n```\nif (access_key && config.master.api.access_key.indexOf(access_key) !== -1) {\n```\n\nFor an access_key that is set to anything that includes the letter 'a' the following request would be authorized.\n\n```\n$ curl -X POST \"http://localhost:8081/api/exec\" -H \"Content-Type: application/json\" -d @test -H \"access-key: a\"\n{\n \"cmd\": \"ls\",\n \"path\": \".\",\n \"stdout\": \"app.js\\nconfig.js\\nlog\\nnode_modules\\nserver.js\\n\",\n \"stderr\": \"\"\n}\n```\n\n\n\n## Recommendation\n\nUpdate to version 0.0.6 or later.","published":"2020-08-31T22:59:07Z","modified":"2023-11-08T03:57:29.057540Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"npm","name":"tomato","fixedVersion":"0.0.6"}],"fix":{"url":"https://github.com/leizongmin/tomato/commit/9e427d524e04a905312a3294c85e939ed7d57b8c","label":"leizongmin/tomato@9e427d5"},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2013-7379"},{"type":"WEB","url":"https://github.com/leizongmin/tomato/commit/9e427d524e04a905312a3294c85e939ed7d57b8c"},{"type":"PACKAGE","url":"https://github.com/leizongmin/tomato"},{"type":"WEB","url":"https://www.npmjs.com/advisories/38"},{"type":"WEB","url":"http://www.openwall.com/lists/oss-security/2014/05/13/1"},{"type":"WEB","url":"http://www.openwall.com/lists/oss-security/2014/05/15/2"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2023-11-08T03:57:29.057540Z"}}