fix(domain,app): own-key lookups for untrusted ids in the v2 migration, attachment and PDF size caps; EVAL-011, journal, TODO

This commit is contained in:
bchanot committed 2026-10-10 12:23:03 +02:00
1 parent 17a6d9b323
commit e7f4167ada
8 files changed
+76 -5

No files matched your search

@@ -224,3 +224,34 @@ describe('readReportDocument', () => {
}
})
})
describe('hostile identifiers', () => {
it('treats prototype keys as unknown ids instead of throwing', () => {
const odd = {
...ReportV2Schema.parse(minimal),
observations: [
{
id: 'o',
zones: [
{ boneId: '__proto__' },
{ boneId: 'constructor', detailSourceId: '__proto__' },
],
findings: [
{
zoneId: 'constructor',
path: ['__proto__'],
labelFrSnapshot: 'X',
labelEnSnapshot: 'X',
},
],
freeTextFindings: [],
comment: '',
},
],
}
const out = migrateReportV2ToV3(ReportV2Schema.parse(odd), MAP)
expect(out.unresolvedZones).toBe(2)
expect(out.unresolvedFindings).toBe(1)
expect(out.report.observations[0]!.zones[1]!.viewId).toBe('__proto__')
})
})