Skip to content

Commit

Permalink
sanitize just the stacktrace (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliseier authored Jan 4, 2024
1 parent b9c66cb commit ed12c6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ exports.wrapSequelize = (sequelize) => {
// Allow only alphanumeric, periods, slashes, dashes, underscores,
// spaces, newlines. The main concern is preventing injection of '*/
// within the stacktrace.
const commentStr = `stacktrace='${makeMinimalUsefulStacktrace()}'`.replace(/[^\w.:/\\\-\s\n]/g, '');
const commentStr = `stacktrace='${makeMinimalUsefulStacktrace().replace(/[^\w.:/\\\-\s\n]/g, '')}'`;

if (commentStr && commentStr.length > 0)
sql = `${sql} /*${commentStr}*/`;
Expand Down

0 comments on commit ed12c6a

Please sign in to comment.