Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
smarty-xss
Advanced tools
Readme
npm install smarty-xss
通过配置对应类型(js、event、path、xml、data)的转义插件名称,对Smarty模板进行XSS检验修复。
var xss = require('smarty-xss');
var option = {}
escapeMap = {
'js' : 'f_escape_js',
'html' : 'f_escape_xml',
'data' : 'f_escape_data',
'path' : 'f_escape_path',
'event' : 'f_escape_event',
'no_escape' : 'escape:none'
};
//不同类型对应的转义列表,默认为空
option['escapeMap'] = escapeMap;
//Smarty模板变量左定界符,默认为:<&
option['leftDelimiter'] = '{#';
//Smarty模板变量右定界符,默认为:&>
option['rightDelimiter'] = '#}';
//XSS安全变量,不需要进行转义
option['xssSafeVars'] = ['fis_safe','fis_xss'];
//设置参数
xss.config(option);
//只进行校验,返回为记录校验信息的数组
var check-result = xss.check('<div class="{#$spUserInfo.userName#}">{#$spUserInfo.city#}</div>');
//进行校验修复,返回为修复后的内容
var result = xss.repair('<div class="{#$spUserInfo.userName#}">{#$spUserInfo.city#}</div>');
在源码目录执行命令:npm test
FAQs
XSS repair or check for the smarty template.
The npm package smarty-xss receives a total of 4 weekly downloads. As such, smarty-xss popularity was classified as not popular.
We found that smarty-xss demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.