Skip to content

Vulnerability: unterminated img src causes long execution #257

@wheresrhys

Description

@wheresrhys

The following test runner demonstrates the problem

const test = async (zeroes) => {
	const start = Date.now();
	const characterCount = Number('1' + [...Array(Number(zeroes))].map(() => '0').join(''))
	autolinker.link(`<img src="${[...Array(characterCount)].join('a')}`)
	console.log(`src of length ${characterCount} took ${Date.now() - start} ms`)
}


const testRunner = async degrees=> {

	const zeroes = [...Array(degrees)].map((_, i) => i);
	for (i in zeroes) {
		await test(i)
	}

}

testRunner(7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions