mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 07:26:19 +00:00
㊙️ Security Fixes
- XSS fix: Created SanitizeHtml.ts utility using DOMPurify (already in package.json but never used). Wrapped all 21 dangerouslySetInnerHTML calls in catalog views with SanitizeHtml() — only allows safe tags (b, i, u, br, span, div, p, a, strong, em, img) - Race condition fix: Added 10-second timeout fallbacks on purchase flags in CatalogPurchaseWidgetView and CatalogGiftView so the flag auto-resets even if the server never responds
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { GetTargetedOfferComposer, PurchaseTargetedOfferComposer, TargetedOfferData } from '@nitrots/nitro-renderer';
|
||||
import { Dispatch, SetStateAction, useMemo, useState } from 'react';
|
||||
import { FriendlyTime, GetConfigurationValue, LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { FriendlyTime, GetConfigurationValue, LocalizeText, SanitizeHtml, SendMessageComposer } from '../../../../api';
|
||||
import { Button, Column, Flex, LayoutCurrencyIcon, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common';
|
||||
import { usePurse } from '../../../../hooks';
|
||||
|
||||
@@ -63,7 +63,7 @@ export const OfferWindowView = (props: { offer: TargetedOfferData, setOpen: Disp
|
||||
<h4>
|
||||
{ LocalizeText(offer.title) }
|
||||
</h4>
|
||||
<div dangerouslySetInnerHTML={ { __html: offer.description } } />
|
||||
<div dangerouslySetInnerHTML={ { __html: SanitizeHtml(offer.description) } } />
|
||||
</Column>
|
||||
<Flex alignItems="center" alignSelf="center" gap={ 2 } justifyContent="center">
|
||||
{ offer.purchaseLimit > 1 &&
|
||||
|
||||
Reference in New Issue
Block a user