Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 2026-07-04 - Prevent stack trace exposure in Discord error logging
**Vulnerability:** The application was appending full error stack traces to Discord moderation log messages when debug mode was enabled.
**Learning:** By appending error stack traces directly to messages broadcasted through an external platform API like Discord, sensitive internal server details and file paths could be exposed to unauthorized users in the log channel.
**Prevention:** In external-facing event logging, securely log detailed stack traces internally (e.g., via `console.error(e.stack)`) while ensuring only generic or stripped down error summaries are appended to public/moderation logs.
4 changes: 3 additions & 1 deletion bot/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ function checkMessageForCommand(msg, isEdit) {
var msgTxt = 'command ' + cmdTxt + ' failed :(';
var linebreak = '\n-------------------------------------------------\n';
if (config.debug) {
msgTxt += '\n' + e.stack;
// πŸ›‘οΈ Sentinel: Do not append stack traces to Discord messages
// Log internally instead to prevent sensitive information leakage
console.error(e.stack);
}
var time = moment()
.tz('America/Los_Angeles')
Expand Down