Vulnerabilities in pkg:npm/taylored

PACKAGE
Advisory Summary

GHSA-vh5j-5fhq-9xwg is a LOW taylor has race condition vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Taylored libraries in the npm ecosystem. The issue involves taylor has race condition in /get-patch that allows purchase token replay. Remediation is available by upgrading affected packages to version 8.1.3.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/taylored

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/taylored. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-vh5j-5fhq-9xwg - LOW Taylor has race condition in /get-patch that allows purchase token replay
GHSA-8g98-m4j9-qww5 - CRITICAL Taylored webhook validation vulnerabilities

GHSA-vh5j-5fhq-9xwg at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-vh5j-5fhq-9xwg
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Taylored
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-vh5j-5fhq-9xwg

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

taylored fixed: 8.1.3
npm install taylored@8.1.3
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 taylored

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-vh5j-5fhq-9xwg, inspect your project dependencies using npm:

npm ls taylored

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

Note: The npm ls taylored 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-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. In Taylored, 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

Hi team, I was looking at the recent fix and you limited the exploitability of race conditions but unfortunately it is still possible to exploit the issue since two requests happening at the exact same time will still go through. You should be able to completely fix the race conditions by leveraging SQLITE write lock and just send one query. ### Summary The /get-patch endpoint processes a purchase in two separate database queries: a SELECT that verifies the token is unused, followed by an UPDATE that marks the token as used. Because SQLite only guards each statement, a malicious actor can issue two requests at the exact same moment and have both SELECT statements succeed before either UPDATE runs. ### Details The handler executes (step 1): ``` SELECT id, token_used_at FROM purchases WHERE patch_id = ? AND purchase_token = ? AND status = 'COMPLETED' ``` If token_used_at IS NULL, the request passes the check (step 2): ``` if (row.token_used_at) { return res.status(403).json({ error: "Purchase token has already been used." }); } ``` The handler finally runs (step 3): ``` UPDATE purchases SET token_used_at = CURRENT_TIMESTAMP WHERE id = ? ``` When two requests arrive at the same time, they both finish step 1 while the row is still unused. SQLite serializes writers only per statement, so each request believes it has exclusive access. Both decrypt and return the patch, and both UPDATE statements succeed. ### PoC To perform this attack, you need to send two requests at the exact same time. ### Impact An attacker who possesses a valid purchase token can replay it and receive multiple copies of the paid patch, or distribute one copy while still keeping their own. This results in revenue loss and undermines license enforcement. ### Remediation Replace the read-then-write sequence with a single atomic statement that both validates and consumes the token while SQLite holds the write lock: ``` const row = db.prepare(` UPDATE purchases SET token_used_at = CURRENT_TIMESTAMP WHERE patch_id = ? AND purchase_token = ? AND status = 'COMPLETED' AND token_used_at IS NULL RETURNING id; `).get(patchId, token); if (!row) return res.status(403).json({ error: 'Invalid or already-used token.' }); ```

GHSA-vh5j-5fhq-9xwg Affected Taylored Versions

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

References

Frequently Asked Questions

What is GHSA-vh5j-5fhq-9xwg?
GHSA-vh5j-5fhq-9xwg is a security vulnerability in Taylored involving Taylor has race condition in /get-patch that allows purchase token replay under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Taylored versions are affected?
Affected versions include releases prior to 8.1.3 across affected packages: taylored.
What version fixes GHSA-vh5j-5fhq-9xwg?
Upgrading to 8.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is taylored affected?
Yes, taylored is affected in releases prior to 8.1.3. Upgrade your dependency to 8.1.3 or later.
What CWE is associated with GHSA-vh5j-5fhq-9xwg?
GHSA-vh5j-5fhq-9xwg is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check npm dependencies for GHSA-vh5j-5fhq-9xwg?
Run the dependency tree command: 'npm ls taylored'. 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-vh5j-5fhq-9xwg",
  "modified" : "2025-06-30T12:53:28Z",
  "published" : "2025-06-27T22:06:48Z",
  "aliases" : [ ],
  "summary" : "Taylor has race condition in /get-patch that allows purchase token replay",
  "details" : "Hi team,\n\nI was looking at the recent fix and you limited the exploitability of race conditions but unfortunately it is still possible to exploit the issue since two requests happening at the exact same time will still go through. You should be able to completely fix the race conditions by leveraging SQLITE write lock and just send one query.\n\n### Summary\nThe /get-patch endpoint processes a purchase in two separate database queries: a SELECT that verifies the token is unused, followed by an UPDATE that marks the token as used. Because SQLite only guards each statement, a malicious actor can issue two requests at the exact same moment and have both SELECT statements succeed before either UPDATE runs.\n\n### Details\n\nThe handler executes (step 1):\n\n```\nSELECT id, token_used_at FROM purchases WHERE patch_id = ? AND purchase_token = ? AND status = 'COMPLETED'\n```\n\nIf token_used_at IS NULL, the request passes the check (step 2): \n```\n        if (row.token_used_at) {\n            return res.status(403).json({ error: \"Purchase token has already been used.\" });\n        }\n```\n\n\nThe handler finally runs (step 3):\n\n```\nUPDATE purchases SET token_used_at = CURRENT_TIMESTAMP WHERE id = ?\n```\n\n\nWhen two requests arrive at the same time, they both finish step 1 while the row is still unused. SQLite serializes writers only per statement, so each request believes it has exclusive access. Both decrypt and return the patch, and both UPDATE statements succeed.\n\n### PoC\nTo perform this attack, you need to send two requests at the exact same time. \n\n### Impact\nAn attacker who possesses a valid purchase token can replay it and receive multiple copies of the paid patch, or distribute one copy while still keeping their own. This results in revenue loss and undermines license enforcement.\n\n\n### Remediation\n\nReplace the read-then-write sequence with a single atomic statement that both validates and consumes the token while SQLite holds the write lock:\n\n```\nconst row = db.prepare(`\n  UPDATE purchases\n     SET token_used_at = CURRENT_TIMESTAMP\n   WHERE patch_id       = ?\n     AND purchase_token = ?\n     AND status         = 'COMPLETED'\n     AND token_used_at IS NULL\n  RETURNING id;\n`).get(patchId, token);\n\nif (!row) return res.status(403).json({ error: 'Invalid or already-used token.' });\n```",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "taylored"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.1.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 8.1.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/tailot/taylored/security/advisories/GHSA-vh5j-5fhq-9xwg"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/tailot/taylored/commit/fdf67a6fba0deae30912905a79fb5a9e83751a79"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/tailot/taylored"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-27T22:06:48Z",
    "nvd_published_at" : null
  }
}