CVE-2013-7379: Tomato API Admin Auth Weakness Vulnerability

CRITICAL
Advisory Identifier: GHSA-9vxc-g2jx-qj3p
CWE-287
Published
Advisory Summary

CVE-2013-7379 is a CRITICAL api admin auth weakness vulnerability (CWE-287: Improper Authentication) affecting Tomato libraries in the npm ecosystem. The issue involves api admin auth weakness in tomato. Remediation is available by upgrading affected packages to version 0.0.6.

CVE-2013-7379 at a Glance

CVE Identifier CVE-2013-7379
GHSA Identifier GHSA-9vxc-g2jx-qj3p
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-287: Improper Authentication
Affected Product Tomato
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2013-7379

To remediate this vulnerability, upgrade all affected Tomato dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

tomato fixed: 0.0.6
npm install tomato@0.0.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls tomato

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2013-7379, inspect your project dependencies using npm:

npm ls tomato

Analyze the terminal output to locate any version of Tomato in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.6), your application is affected.

Note: The npm ls tomato command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-287: Improper Authentication, where when an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct. In Tomato, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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. ## Details The 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. Tomato 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. ## Proof of Concept This is the snippet of code that does the comparison to authorize requests. ``` if (access_key && config.master.api.access_key.indexOf(access_key) !== -1) { ``` For an access_key that is set to anything that includes the letter 'a' the following request would be authorized. ``` $ curl -X POST "http://localhost:8081/api/exec" -H "Content-Type: application/json" -d @test -H "access-key: a" { "cmd": "ls", "path": ".", "stdout": "app.js\nconfig.js\nlog\nnode_modules\nserver.js\n", "stderr": "" } ``` ## Recommendation Update to version 0.0.6 or later.

CVE-2013-7379 Affected Tomato Versions

1 component(s)
Fixed Versions:
0.0.6
Product / Package Ecosystem Affected Versions Fixed Version
tomato
npm
< 0.0.6
0.0.6

References

Frequently Asked Questions

What is CVE-2013-7379?
CVE-2013-7379 is a security vulnerability in Tomato involving API Admin Auth Weakness in tomato under CWE-287: Improper Authentication.
Which Tomato versions are affected?
Affected versions include releases prior to 0.0.6 across affected packages: tomato.
What version fixes CVE-2013-7379?
Upgrading to 0.0.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tomato affected?
Yes, tomato is affected in releases prior to 0.0.6. Upgrade your dependency to 0.0.6 or later.
What CWE is associated with CVE-2013-7379?
CVE-2013-7379 is classified under CWE-287: Improper Authentication (When an actor claims to have a given identity, the product does not prove or insufficiently proves that the claim is correct.).
How can I check npm dependencies for CVE-2013-7379?
Run the dependency tree command: 'npm ls tomato'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9vxc-g2jx-qj3p",
  "modified" : "2021-09-23T21:00:28Z",
  "published" : "2020-08-31T22:59:07Z",
  "aliases" : [ "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.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "tomato"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.0.5"
    }
  } ],
  "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-287" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:08:49Z",
    "nvd_published_at" : null
  }
}