Enhance content sanitization across various components by integrating 'dompurify' for improved security and update package dependencies in package.json and package-lock.json.
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 4m56s
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 4m56s
This commit is contained in:
@@ -36,6 +36,15 @@ export default defineEventHandler(async (event) => {
|
||||
})
|
||||
}
|
||||
|
||||
// Zusätzliche Path-Traversal-Prüfung
|
||||
const sanitizedFilename = path.basename(path.normalize(filename))
|
||||
if (sanitizedFilename !== filename || sanitizedFilename.includes('..')) {
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: 'Ungültiger Dateiname'
|
||||
})
|
||||
}
|
||||
|
||||
let filePath
|
||||
|
||||
if (isDynamicMannschaft) {
|
||||
@@ -44,7 +53,7 @@ export default defineEventHandler(async (event) => {
|
||||
filePath = path.join(process.cwd(), 'public', 'documents', 'spielplaene', 'spielplan_gesamt.pdf')
|
||||
} else {
|
||||
// Für vordefinierte PDFs
|
||||
filePath = path.join(process.cwd(), 'public', 'documents', 'spielplaene', filename)
|
||||
filePath = path.join(process.cwd(), 'public', 'documents', 'spielplaene', sanitizedFilename)
|
||||
}
|
||||
|
||||
// Prüfe ob Datei existiert
|
||||
|
||||
Reference in New Issue
Block a user