🇰🇷 한글 설명
parisneo/lollms의 POST /api/prompts/share 엔드포인트에서 저장형 XSS 취약점이 발견되었습니다. 공격자가 조작한 prompt_content가 서버 측 검증 없이 DB에 저장되며, 프론트엔드의 불충분한 정규식 기반 필터링을 우회하여 피해자의 브라우저에서 악성 스크립트가 실행될 수 있습니다.
💡 쉬운 설명
공격자가 보낸 메시지에 숨겨진 악성 코드가 포함되어 있어, 사용자가 메시지를 읽는 순간 해커가 사용자의 계정을 조작하거나 정보를 훔칠 수 있는 보안 약점입니다. 메시지 내용이 제대로 걸러지지 않고 웹 화면에 그대로 표시되기 때문에 발생합니다.
🇺🇸 원문 (English)
A stored cross-site scripting (XSS) vulnerability exists in the `POST /api/prompts/share` endpoint of parisneo/lollms (latest version). The endpoint stores attacker-controlled `prompt_content` into `DBDirectMessage.content` without server-side sanitization. When a victim opens the direct message (DM) thread, the message is rendered by the DM UI through `MessageContentRenderer`, which uses `v-html` to insert rendered HTML into the DOM. The frontend sanitizer, which is regex-based, fails to comprehensively sanitize attacker-controlled HTML, allowing malicious payloads to execute in the victim's browser context. This vulnerability enables any authenticated user to send a malicious prompt-share message to another user's inbox, leading to arbitrary JavaScript execution, authenticated actions as the victim, exposure of same-origin application data, and potential account takeover.
📍 영향받는 시스템
parisneo/lollms (최신 버전 포함)
⚔️ 공격 벡터
인증된 사용자가 악성 스크립트가 포함된 프롬프트 공유 메시지를 피해자의 DM으로 전송
🛡️ 대응 방법
서버 측에서 입력값에 대한 강력한 HTML Sanitization을 적용하고, 프론트엔드에서 v-html 대신 안전한 텍스트 렌더링 방식을 사용해야 합니다.