Remixer v3 and Scraper#782
Conversation
…tion and expansion
…opups and responsive design
|
|
||
| const getSupportCenterHref = () => { | ||
| // Always nav to main commons in production, otherwise use the current origin (e.g. development) | ||
| if (window.location.origin.endsWith("libretexts.org")) { |
|
|
||
| const getStoreHref = () => { | ||
| // Always nav to main store in production, otherwise use the current origin (e.g. development) | ||
| if (window.location.origin.endsWith("libretexts.org")) { |
| const existingAuthor = await Author.findOne({ | ||
| email, | ||
| isAdminEntry: false, | ||
| orgID: process.env.ORG_ID, | ||
| }); |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
Show fix
| const existingAuthor = await Author.findOne({ | |
| email, | |
| isAdminEntry: false, | |
| orgID: process.env.ORG_ID, | |
| }); | |
| const existingAuthor = await Author.findOne({ | |
| email: { $eq: email }, | |
| isAdminEntry: false, | |
| orgID: process.env.ORG_ID, | |
| }); |
| await authorService.deleteAuthor(req.params.id); | ||
| const { firstName, lastName, email, primaryInstitution, url } = req.body; | ||
| await Author.updateOne( | ||
| { _id: req.params.id, orgID: process.env.ORG_ID }, |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| { _id: req.params.id, orgID: process.env.ORG_ID }, | |
| { _id: { $eq: req.params.id }, orgID: process.env.ORG_ID }, |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| await Author.deleteOne({ | ||
| _id: req.params.id, | ||
| orgID: process.env.ORG_ID, | ||
| }).orFail(); |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
Show fix
| await Author.deleteOne({ | |
| _id: req.params.id, | |
| orgID: process.env.ORG_ID, | |
| }).orFail(); | |
| await Author.deleteOne({ | |
| _id: { $eq: req.params.id }, | |
| orgID: process.env.ORG_ID, | |
| }).orFail(); |
| subdomain, | ||
| }: RunRemixerJobParams) => { | ||
| const job = await PrejectRemixerJob.findOne({ jobID }).sort({ _id: -1 }); | ||
| const remixerState = await PrejectRemixer.findOne({ projectID }).sort({ _id: -1 }); |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| const remixerState = await PrejectRemixer.findOne({ projectID }).sort({ _id: -1 }); | |
| const remixerState = await PrejectRemixer.findOne({ projectID: { $eq: projectID } }).sort({ _id: -1 }); |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| Project.findOne({ | ||
| projectID: req.body.projectID, | ||
| }).lean().then((project) => { |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| Project.findOne({ | |
| projectID: req.body.projectID, | |
| }).lean().then((project) => { | |
| Project.findOne({ | |
| projectID: { $eq: req.body.projectID }, | |
| }).lean().then((project) => { |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| return Task.findOne({ | ||
| taskID: req.body.parent, | ||
| }).lean(); |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| return Task.findOne({ | |
| taskID: req.body.parent, | |
| }).lean(); | |
| return Task.findOne({ | |
| taskID: { $eq: req.body.parent }, | |
| }).lean(); |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| return Task.updateOne({ | ||
| taskID: task.taskID, | ||
| }, updateObj); |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| return Task.updateOne({ | |
| taskID: task.taskID, | |
| }, updateObj); | |
| return Task.updateOne({ | |
| taskID: { $eq: task.taskID }, | |
| }, updateObj); |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| Project.findOne({ | ||
| projectID: req.query.projectID, | ||
| }).lean().then((project) => { |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
Show fix
Remediation: User input should be validated (e.g. with class-validator, zod or joi) or sanitized (e.g. with mongo-sanitize). Alternatively cast request parameters to their expected type or use the $eq operator to block object injection. You can also Autofix all instances of NoSQL injection by installing Zen for Node.js.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| async function appendPressbooksJobMessages(jobID: string, messages: string[]) { | ||
| if (!messages.length) return; | ||
| await PressbooksImportJob.updateOne( | ||
| { jobID }, |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
Show fix
Remediation: User input should be validated (e.g. with class-validator, zod or joi) or sanitized (e.g. with mongo-sanitize). Alternatively cast request parameters to their expected type or use the $eq operator to block object injection. You can also Autofix all instances of NoSQL injection by installing Zen for Node.js.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| resolve(Task.findOne({ | ||
| taskID, | ||
| }).lean()); |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| resolve(Task.findOne({ | |
| taskID, | |
| }).lean()); | |
| resolve(Task.findOne({ | |
| taskID: { $eq: taskID }, | |
| }).lean()); |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| return Project.findOne({ | ||
| projectID: taskData.projectID, | ||
| }).lean(); |
There was a problem hiding this comment.
NoSQL injection attack possible - high severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| return Project.findOne({ | |
| projectID: taskData.projectID, | |
| }).lean(); | |
| return Project.findOne({ | |
| projectID: { $eq: taskData.projectID }, | |
| }).lean(); |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
There was a problem hiding this comment.
13 Open source vulnerabilities detected - critical severity
Aikido detected 13 vulnerabilities across 4 packages, it includes 2 critical and 11 high vulnerabilities.
Details
Remediation Aikido suggests bumping the vulnerable packages to a safe version.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
There was a problem hiding this comment.
CVE-2026-2391 in qs - high severity
Summary
The arrayLimit option in qs does not enforce limits for comma-separated values when comma: true is enabled, allowing attackers to cause denial-of-service via memory exhaustion. This is a bypass of the array limit enforcement, similar to the bracket notation bypass addressed in GHSA-6rw7-vpxm-498p (CVE-2025-15284).
Details
When the comma option is set to true (not the default, but configurable in applications), qs allows parsing comma-separated strings as arrays (e.g., ?param=a,b,c becomes ['a', 'b', 'c']). However, the limit check for arrayLimit (default: 20) and the optional throwOnLimitExceeded occur after the comma-handling logic in parseArrayValue, enabling a bypass. This permits creation of arbitrarily large arrays from a single parameter, leading to excessive memory allocation.
Vulnerable code (lib/parse.js: lines ~40-50):
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
return val.split(',');
}
if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
}
return val;The split(',') returns the array immediately, skipping the subsequent limit check. Downstream merging via utils.combine does not prevent allocation, even if it marks overflows for sparse arrays.This discrepancy allows attackers to send a single parameter with millions of commas (e.g., ?param=,,,,,,,,...), allocating massive arrays in memory without triggering limits. It bypasses the intent of arrayLimit, which is enforced correctly for indexed (a[0]=) and bracket (a[]=) notations (the latter fixed in v6.14.1 per GHSA-6rw7-vpxm-498p).
PoC
Test 1 - Basic bypass:
npm install qs
const qs = require('qs');
const payload = 'a=' + ','.repeat(25); // 26 elements after split (bypasses arrayLimit: 5)
const options = { comma: true, arrayLimit: 5, throwOnLimitExceeded: true };
try {
const result = qs.parse(payload, options);
console.log(result.a.length); // Outputs: 26 (bypass successful)
} catch (e) {
console.log('Limit enforced:', e.message); // Not thrown
}Configuration:
comma: truearrayLimit: 5throwOnLimitExceeded: true
Expected: Throws "Array limit exceeded" error.
Actual: Parses successfully, creating an array of length 26.
Impact
Denial of Service (DoS) via memory exhaustion.
Details
Remediation Aikido suggests bumping this package to version 6.14.2 to resolve this issue
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| title: 1, | ||
| _id: 0, | ||
| }; | ||
| const project = await Project.findOne({ projectID: id }, projection); |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| const project = await Project.findOne({ projectID: id }, projection); | |
| const project = await Project.findOne({ projectID: { $eq: id } }, projection); |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| const actorUUID = (req as any).user?.decoded?.uuid ?? ""; | ||
|
|
||
| const project = await Project.findOne( | ||
| { projectID: id }, |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| { projectID: id }, | |
| { projectID: { $eq: id } }, |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| } | ||
|
|
||
| const remixerState = await PrejectRemixer.findOneAndUpdate( | ||
| { projectID: id, archived: false }, |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| { projectID: id, archived: false }, | |
| { projectID: { $eq: id }, archived: false }, |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| }); | ||
| } | ||
|
|
||
| await PrejectRemixer.deleteOne({ projectID: id }); |
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| await PrejectRemixer.deleteOne({ projectID: id }); | |
| await PrejectRemixer.deleteOne({ projectID: { $eq: id } }); |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
| @@ -1334,8 +1350,7 @@ async function deleteTicket( | |||
| ) { | |||
| try { | |||
| const { uuid } = req.params; | |||
| const ticketService = new SupportTicketService(); | |||
| await ticketService.deleteTicket(uuid); | |||
| await SupportTicket.deleteOne({ uuid }); | |||
There was a problem hiding this comment.
NoSQL injection attack possible - critical severity
Query injection attacks are possible if users can pass objects instead of strings to query functions such as findOne.
By injecting query operators attackers can control the behavior of the query, allowing them to bypass access controls and extract unauthorized data. Consider the attack payload ?user_id[$ne]=5: if the user_id query parameter is passed to the query function without validation or casting its type, an attacker can pass {$ne: 5} instead of an integer to the query. {$ne: 5} uses the 'not equal to' operator to access data of other users.
While this vulnerability is known as NoSQL injection, relational databases (mysql, postgres) are also vulnerable to this attack if the query library offers a NoSQL-like API and supports string-typed query operators. Examples include prisma and sequelize versions prior to 4.12.0.
| await SupportTicket.deleteOne({ uuid }); | |
| await SupportTicket.deleteOne({ uuid: { $eq: uuid } }); |
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
|
Superceded by #785 |
No description provided.