mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 08:56:17 -04:00
ImportEtherpad: Reject unknown DB records
This commit is contained in:
parent
8e9bc8d325
commit
00fc7c8e86
2 changed files with 16 additions and 5 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
const assert = require('assert').strict;
|
||||
const authorManager = require('../../../node/db/AuthorManager');
|
||||
const db = require('../../../node/db/DB');
|
||||
const importEtherpad = require('../../../node/utils/ImportEtherpad');
|
||||
const padManager = require('../../../node/db/PadManager');
|
||||
const {randomString} = require('../../../static/js/pad_utils');
|
||||
|
@ -52,6 +53,15 @@ describe(__filename, function () {
|
|||
assert(!await padManager.doesPadExist(padId));
|
||||
});
|
||||
|
||||
it('unknown db records are ignored', async function () {
|
||||
const badKey = `maliciousDbKey${randomString(10)}`;
|
||||
await importEtherpad.setPadRaw(padId, JSON.stringify({
|
||||
[badKey]: 'value',
|
||||
...makeExport(makeAuthorId()),
|
||||
}));
|
||||
assert(await db.get(badKey) == null);
|
||||
});
|
||||
|
||||
describe('author pad IDs', function () {
|
||||
let existingAuthorId;
|
||||
let newAuthorId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue