Merge branch 'main' into fix/session-manager-attachment-extensions

This commit is contained in:
gavrielc
2026-04-30 10:39:50 +03:00
committed by GitHub
7 changed files with 52 additions and 27 deletions

View File

@@ -373,6 +373,11 @@ export function readOutboxFiles(
if (!fs.existsSync(outboxDir)) return undefined;
const files: OutboundFile[] = [];
for (const filename of filenames) {
// Reject any name that isn't a bare basename before touching the filesystem.
if (!isSafeAttachmentName(filename)) {
log.warn('Refused unsafe outbox filename — would escape outbox', { messageId, filename });
continue;
}
const filePath = path.join(outboxDir, filename);
if (fs.existsSync(filePath)) {
files.push({ filename, data: fs.readFileSync(filePath) });