1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 16:56:00 +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:
copilot-swe-agent[bot]
2025-12-01 02:18:44 +00:00
parent 69c8d8e102
commit ffdc78b354
4 changed files with 9 additions and 10 deletions

View File

@@ -62,7 +62,7 @@ function createMembers(record: LocaleRecord): ts.TypeElement[] {
}
export async function generateLocaleInterface(localesDir: string): Promise<void> {
const locale = yaml.load(fs.readFileSync(`${localesDir}/ja-JP.yml`, 'utf-8').toString()) as LocaleRecord;
const locale = yaml.load(fs.readFileSync(`${localesDir}/ja-JP.yml`, 'utf-8').toString(), { schema: yaml.JSON_SCHEMA }) as LocaleRecord;
const members = createMembers(locale);
const elements: ts.Statement[] = [