GHSA-vh5j-5fhq-9xwg — taylored
Fix: tailot/taylored@fdf67a6GHSA-vh5j-5fhq-9xwg is a security vulnerability in taylored. A fix is available for taylored — see the affected versions and patch details below.
Taylor has race condition in /get-patch that allows purchase token replay
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
taylorednpmDescription
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.' });
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | taylored | all versions | 8.1.3npm install taylored@8.1.3 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for taylored, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update taylored to 8.1.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-vh5j-5fhq-9xwg is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-vh5j-5fhq-9xwg can be triaged on real exposure rather than presence alone.
Tailored to GHSA-vh5j-5fhq-9xwg. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-vh5j-5fhq-9xwg in your dependencies?
O3 Security finds GHSA-vh5j-5fhq-9xwg across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.