mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 22:15:41 +02:00
Use safe yaml.JSON_SCHEMA to prevent code execution vulnerabilities
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
@@ -28,7 +28,7 @@ if (!fs.existsSync(configYmlPath)) {
|
||||
}
|
||||
|
||||
const yamlContent = fs.readFileSync(configYmlPath, 'utf-8');
|
||||
const config = yaml.load(yamlContent);
|
||||
const config = yaml.load(yamlContent, { schema: yaml.JSON_SCHEMA });
|
||||
fs.writeFileSync(configJsonPath, JSON.stringify(config, null, '\t'), 'utf-8');
|
||||
|
||||
console.log(`Compiled config: ${configYmlPath} -> ${configJsonPath}`);
|
||||
|
||||
Reference in New Issue
Block a user