mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-06-03 21:02:16 +08:00
fix(security): xss via v-html with user-controlled content
The Footer.vue component renders openSettings.copyright using v-html without sanitization. If an attacker can control the copyright setting (e.g., via admin panel or database), they can inject malicious JavaScript that executes in all users' browsers. Affected files: Footer.vue Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
This commit is contained in:
parent
add0124cfd
commit
200759c9e8
@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import { useScopedI18n } from '@/i18n/app'
|
||||
import { useGlobalState } from '../store'
|
||||
import DOMPurify from 'dompurify'
|
||||
const { openSettings } = useGlobalState()
|
||||
|
||||
|
||||
@ -17,7 +18,7 @@ const { t } = useScopedI18n('views.Footer')
|
||||
{{ t('copyright') }} © 2023-{{ new Date().getFullYear() }}
|
||||
</n-text>
|
||||
<n-text depth="3">
|
||||
<div v-html="openSettings.copyright"></div>
|
||||
<div v-html="DOMPurify.sanitize(openSettings.copyright)"></div>
|
||||
</n-text>
|
||||
</n-space>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user