Alienbin MongoDB TTL Index Race Condition Vulnerability Allowing Unauthorized Data Deletion
Vulnerability
A vulnerability exists in Alienbin versions through 1.0.0, specifically in the '/save' endpoint of 'server.js'. This issue arises because the endpoint drops and recreates the MongoDB TTL index on the entire post collection with each new paste submission. When a user submits a paste with a short TTL, the index is updated to reflect that short duration for all documents, causing previously set longer-duration pastes to be deleted prematurely. This flaw allows an attacker to delete all existing pastes by repeatedly submitting pastes with a short TTL.
Impact
Exploitation of this vulnerability leads to unauthorized deletion of other users' pastes, causing a mass loss of data.
Remediation
To address this vulnerability, implement a per-document TTL expiration field and use a single TTL index that references this field, allowing each document to expire independently.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
