mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix: path traversal in install.sh, error logging in hooks
- Validate language names in install.sh to prevent path traversal via malicious args like ../../etc (only allow [a-zA-Z0-9_-]) - Replace silent catch in check-console-log.js with stderr logging so hook failures are visible to the user for debugging - Escape backticks in session-end.js user messages to prevent markdown structure corruption in session files
This commit is contained in:
parent
f3a4b33d41
commit
6e5b45ed28
3 changed files with 14 additions and 4 deletions
|
|
@ -59,8 +59,8 @@ process.stdin.on('end', () => {
|
|||
if (hasConsole) {
|
||||
log('[Hook] Remove console.log statements before committing');
|
||||
}
|
||||
} catch {
|
||||
// Silently ignore errors (git might not be available, etc.)
|
||||
} catch (err) {
|
||||
log(`[Hook] check-console-log error: ${err.message}`);
|
||||
}
|
||||
|
||||
// Always output the original data
|
||||
|
|
|
|||
|
|
@ -157,10 +157,10 @@ ${summarySection}
|
|||
function buildSummarySection(summary) {
|
||||
let section = '## Session Summary\n\n';
|
||||
|
||||
// Tasks (from user messages)
|
||||
// Tasks (from user messages — escape backticks to prevent markdown breaks)
|
||||
section += '### Tasks\n';
|
||||
for (const msg of summary.userMessages) {
|
||||
section += `- ${msg}\n`;
|
||||
section += `- ${msg.replace(/`/g, '\\`')}\n`;
|
||||
}
|
||||
section += '\n';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue