This is a simple React app that allows users to submit complaints and react to them.
This application contains intentional security vulnerabilities for educational purposes. It should only be run in a controlled, isolated development environment. Never deploy this application to a production environment or expose it to the public internet.
yarn install
yarn run devInstall testing dependencies:
yarn test:installRun the tests:
yarn testRun tests with UI:
yarn run test:uiThe username is rendered in the complaint feed without sanitization.
<div className="text-sm text-gray-600 mb-2" dangerouslySetInnerHTML={{ __html:
`Posted by: ${complaint.username}` }} />The complaint text is rendered in the complaint feed without sanitization.
<div
className="text-gray-800 mb-4"
dangerouslySetInnerHTML="{{"
__html:
complaint.description
}}
/>http://localhost:3000/?query=%3Cimg%20src=x%20onerror=%22alert(5)%22/%3E
The search query is rendered straight from the URL.
{searchResult && (
<div
className="p-4 bg-karen-primary-50 rounded"
dangerouslySetInnerHTML="{{"
__html:
searchResult
}}
/>
)}