Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
用于微信授权和微信签名
Using npm:
$ npm i wxAuth -S
In project:
import wxAuth from "wxAuth";
const WxInstance = WxAuth.getInstance();
const authHttp = () => {
const searchParams = locationSearch(window.location.search);
return WxInstance.wxAuth(loginApi.wxGetJsapiSignature, loginApi.wxGetAuth, {
auth: {
code: searchParams.code,
type: "parent",
clientKey: searchParams.clientKey || "",
},
signature: {
clientKey: searchParams.clientKey || "",
url: window.location.href.split("#")[0],
},
});
};
// vue-router beforeEach
xport function routerBeforeEachFunc(to, from, next) {
authHttp()
.then((res) => {
// 已授权
if (res.status === 'authed') {
// 判断是否已经获取了用户信息,如果没有获取,则在此处获取
} else if (res.status === 'failed') {
// 表示授权失败
// eslint-disable-next-line no-invalid-this
this.$toast.fail(res.message)
}
next()
})
.catch(() => {
// 如果是生产环境,则需要重定向到微信授权页面,进入到此处,说明url上没有code,session中也没有token
if (process.env.NODE_ENV === 'production') {
WxInstance.wxAuthRedirect()
} else {
// 开发环境,可以在此处写入token信息到session中
next()
}
})
}
FAQs
weixin authorization
The npm package wxtoken receives a total of 1 weekly downloads. As such, wxtoken popularity was classified as not popular.
We found that wxtoken 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.