Refractoring Stage 5 DAV functions EDIT/DEL tied to creators account

This commit is contained in:
2026-10-16 17:15:20 +03:00
parent 0b52949f23
commit 88a8729f4f
6 changed files with 190 additions and 15 deletions
+6
View File
@@ -32,3 +32,9 @@ test('serializes contacts with escaped fields and an injected identifier', () =>
'N:Example Lovelace;Ada;;;\r\nEMAIL:ada@example.com\r\n' +
'NOTE:Research\\, analysis\\; mathematics\r\nEND:VCARD\r\n');
});
test('rejects DAV identifiers that can inject fields or escape resource paths', () => {
assert.throws(() => makeCalendarData({ date: '2026-10-16', title: 'Bad', _dav: { uid: 'good\r\nX-Evil: yes' } }), /identifier is invalid/);
assert.throws(() => makeCalendarData({ date: '2026-10-16', title: 'Bad', _dav: { uid: '../other' } }), /identifier is invalid/);
assert.throws(() => makeVcard({ name: 'Bad', email: 'x@example.test', _dav: { uid: 'x'.repeat(256) } }), /identifier is invalid/);
});