Skip to content

Commit 19d4b45

Browse files
authored
fix(react-email): security issue with path for static files (#2289)
1 parent b6e961a commit 19d4b45

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/kind-showers-exist.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-email": patch
3+
---
4+
5+
fix static file serving security issue with logging

packages/react-email/src/utils/preview/serve-static-file.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export const serveStaticFile = async (
3838
} else {
3939
const sanitizedFilePath = fileAbsolutePath.replace(/\n|\r/g, '');
4040
console.error(
41-
`Could not read file at ${sanitizedFilePath} to be served, here's the exception:`,
41+
`Could not read file at %s to be served, here's the exception:`,
42+
sanitizedFilePath,
4243
exception,
4344
);
4445

0 commit comments

Comments
 (0)