GHSA-vh5j-5fhq-9xwg: Taylored Taylor Has Race Condition Vulnerability
LOWGHSA-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.
GHSA-vh5j-5fhq-9xwg at a Glance
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.
npm install taylored@8.1.3
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
GHSA-vh5j-5fhq-9xwg Affected Taylored Versions
1 component(s)| 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?
Which Taylored versions are affected?
What version fixes GHSA-vh5j-5fhq-9xwg?
Is taylored affected?
What CWE is associated with GHSA-vh5j-5fhq-9xwg?
How can I check npm dependencies for GHSA-vh5j-5fhq-9xwg?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}