Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade library and dependencies to require taffydb@^upgrade #933

Closed
bangtabil opened this issue Mar 26, 2024 · 1 comment
Closed

Upgrade library and dependencies to require taffydb@^upgrade #933

bangtabil opened this issue Mar 26, 2024 · 1 comment
Labels

Comments

@bangtabil
Copy link

Describe the bug
TaffyDB allows attackers to forge adding additional properties into user-input processed by taffy which can allow access to any data items in the DB. Taffy sets an internal index for each data item in its DB. However, it is found that the internal index can be forged by adding additional properties into user-input. If index is found in the query, TaffyDB will ignore other query conditions and directly return the indexed data item. Moreover, the internal index is in an easily-guessable format (e.g., T000002R000001). As such, attackers can use this vulnerability to access any data items in the DB. Note: taffy and its successor package taffydb are not maintained.

Internal Property Tampering. taffy sets an internal index for each data item in its DB. However, it is found that the internal index can be forged by adding additional properties into user-input. If an index is found in the query, taffyDB will ignore other query conditions and directly return the indexed data item. Moreover, the internal index is in an easily-guessable format (e.g. T000002R000001). As such, attackers can use this vulnerability to access any data items in the DB and exploit an SQL Injection.

PoC

var TAFFY = require('taffy');
var friends = TAFFY([
        {"id":1,"gender":"M","stellar","status":"Active"},
]);

var json = {username:"Smith", "password":"123", "___id":"T000002R000002", "___s":true};
var item1 = friends(json);
console.log(item1.first());

What version are you on?
Check yarn.lock or package-lock.json to find out precisely what version of the SDK you're running.

Additional context
CVE-2019-10790
CWE-20
WeaknessCWE-668
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

@bangtabil bangtabil added the bug label Mar 26, 2024
@Shaptic
Copy link
Contributor

Shaptic commented Apr 30, 2024

taffydb is only used when generating docs which are a static webpage, so this vulnerability does not impact us

@Shaptic Shaptic closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants