mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-03-14 10:27:24 +00:00
fix(security): disable executable gray-matter frontmatter in commands
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import matter from 'gray-matter';
|
||||
import { promises as fs } from 'fs';
|
||||
import path from 'path';
|
||||
import { execFile } from 'child_process';
|
||||
import { promisify } from 'util';
|
||||
import { parse as parseShellCommand } from 'shell-quote';
|
||||
import { parseFrontmatter } from './frontmatter.js';
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
|
||||
@@ -32,7 +32,7 @@ const BASH_COMMAND_ALLOWLIST = [
|
||||
*/
|
||||
export function parseCommand(content) {
|
||||
try {
|
||||
const parsed = matter(content);
|
||||
const parsed = parseFrontmatter(content);
|
||||
return {
|
||||
data: parsed.data || {},
|
||||
content: parsed.content || '',
|
||||
|
||||
Reference in New Issue
Block a user