
Security News
Potemkin Understanding in LLMs: New Study Reveals Flaws in AI Benchmarks
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
web-security
Advanced tools
Securing web application by preventing cross site scripting (XSS) attack across the browsers.
Copyright © http://randomrise.com, as an published work. All rights reserved.
This software is the property of randomrise technology
This software intend to provide open source (FREE TO USE) but any reproduction is not allowed
@contact: http://randomrise.com
@author: ChandraShekher Polimera (linkedin: chandrashekherpolimera | email: chandrashekher@techie.com)
@github: https://github.com/chandragithub/web-security
@date: 14/08/2016
@version: 0.0.3 (beta)
It prevents cross site scripting (xss) attack across the browsers.
Cross-site scripting (XSS) is a code injection attack that allows an attacker to execute malicious JavaScript in another user's browser
- Persistent XSS
where the malicious string originates from the website's database.
- Reflected XSS
where the malicious string originates from the victim's request.
- DOM-based XSS
where the vulnerability is in the client-side code rather than the server-side code.
- @param: unSafeHtmlString
escape(param) {};
- @param: unSafeHtmlString
strictEscape(param) {};
- @param: safeHtmlString
reverseEscape(param) {};
- @param: safeHtmlString
unescape(param) {};
- @param: unSafeHtmlString
removeUnsafe(param) {};
- safeUrl() {};
- unSafeUrl() {};
npm install web-security
var xs = require('web-security')
<script type="text/javascript" src="web-security.js"> </script>
<script>
var xs = webSecurity;
</script>
var htmlStr = "<script> alert(document.cookie); </script>";
xs.escape(htmlStr);
// output: "<script> alert(document.cookie); </script>"
var htmlStr = "<script> alert(document.cookie); </script>";
xs.strictEscape(htmlStr);
// output: "<script> alert(document.cookie); </script>"
var htmlStr = "<script> alert(document.cookie); </script>";
xs.reverseEscape(htmlStr);
// output: "<script> alert(document.cookie); </script>"
var htmlStr = "<script> alert(document.cookie); </script>";
xs.unescape(htmlStr);
// output: "<script> alert(document.cookie); </script>"
var htmlStr = "<script> alert(document.cookie); </script>";
xs.removeUnsafe(htmlStr);
// output: "script alert(document.cookie); /script"
var htmlStr = "<script> alert(document.cookie); </script>";
xs.removeStrictUnsafe(htmlStr);
// output: "script alertdocument.cookie /script"
var url = "http://randomrise.com/?<script> document.cookie </script>";
xs.safeUrl(url);
// it will reload/refresh the page without search parameter.
var url = "http://randomrise.com/?<script> document.cookie </script>";
xs.unSafeUrl(url);
// it will reload/refresh the page with search parameter.
FAQs
For ReadMe.md file visit my Github
The npm package web-security receives a total of 5 weekly downloads. As such, web-security popularity was classified as not popular.
We found that web-security demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.