-
Fototrend
JavaScript != Java (A JavaScript nem összekeverendő a Javával, két különböző programozási nyelvről van szó!)
Új hozzászólás Aktív témák
-
nevemfel
senior tag
válasz
Silεncε
#9049
üzenetére
Igazad van, az innerHTML sem biztonságos:
There is one built-in safeguard in place, though. Just injecting a script element won’t expose you to attacks, because the section of the DOM you’re injecting into has already been parsed and run.
// This won't executevar div = document.querySelector('#some-div');div.innerHTML = '<script>alert("XSS Attack");</script>';JavaScript that runs at a later time, though, will.
// This WILL rundiv.innerHTML = '<script deferred>alert("XSS Attack");</script>';// This will, toodiv.innerHTML = '<img src=x onerror="alert(\'XSS Attack\')">';Ez a megoldás viszont ígéretesnek tűnik:
If the third-party content is allowed to contain markup, a helper library like DOMPurify will remove any markup that’s not part of a secure whitelist before injecting it.
Új hozzászólás Aktív témák
- Konzol felvásárlás!! Xbox Series S, Xbox Serries X
- Frissen pasztázva! Playstation 4 Pro 1 TB + kontroller 6 hó garancia, számlával!
- Microsoft Surface Laptop 4 13.5" Ryzen 5 4680U 6magos! 16GB 512GB 1 év garancia
- LG 83B4 - 83" OLED - 4K 120Hz 1ms - NVIDIA G-Sync - FreeSync Premium - HDMI 2.1 - PS5 és Xbox Ready
- ÚJ Lenovo ThinkPad T16 Gen 4 - 16" WUXGA - Ultra 7 255U - 32GB - 1TB SSD - Win11 - 3 év garancia
Állásajánlatok
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest

