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.
survey-monkey-oauth
Advanced tools
Oauth2 authentication tools for SurveyMonkey
const lib = require('survey-monkey-oauth')({
clientId: process.env.clientId,
clientSecret: process.env.clientSecret,
baseURL: 'http://localhost:3000/', /* optional, default baseURL is http://localhost:3000/ */
redirectPath: '/callback/', /* optional, default redirectPath is /callback/ */
scope: 'scopes',
})
if (req.url.match(/login/)) return lib.authorize(req, res)
if (req.url.match(/callback/)) return lib.generateToken(req, res)
// on success
lib.on('success', (tokenRes, res) => {
console.log('success !!!', tokenRes.data)
res.end('token successfully generated')
})
// on failure
lib.on('error', (errorRes, res) => {
console.log('error', errorRes)
})
const http = require('http')
const port = 3000
const hostname = '127.0.0.1'
const lib = require('survey-monkey-oauth')({
clientId: process.env.clientId,
clientSecret: process.env.clientSecret,
baseURL: 'http://localhost:3000/', /* redirect url base */
redirectPath: '/callback/', /* redirect url pathname */
scope: '', /* scopes to request permissions from app users during OAuth */
})
/* on success */
lib.on('success', (tokenRes, res) => {
console.log('success !!!', tokenRes.data)
res.end('token successfully generated')
})
/* on failure */
lib.on('error', (errorRes, res) => {
console.log('error', errorRes)
})
const server = http.createServer((req, res) => {
res.statusCode = 200
res.setHeader('Content-Type', 'text/plain')
if (req.url.match(/login/)) return lib.authorize(req, res) /* /login - initiates oauth authentication */
if (req.url.match(/callback/)) return lib.generateToken(req, res) /* /callback - initiates authorization process */
})
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`)
})
const express = require('express')
const app = express()
const port = 3000
const lib = require('survey-monkey-oauth')({
clientId: process.env.clientId,
clientSecret: process.env.clientSecret,
baseURL: 'http://localhost:3000/', /* redirect url base */
redirectPath: '/callback/', /* redirect url pathname */
scope: '', /* scopes to request permissions from app users during OAuth */
})
// on success
lib.on('success', (tokenRes, res) => {
console.log('success', tokenRes.data)
res.end('token successfully generated')
})
// on failure
lib.on('error', (errorRes, res) => {
console.log('error', errorRes)
})
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.get('/login/', (req, res) => {
lib.authorize(req, res) /* /login - initiates oauth authentication */
})
app.get('/callback/', (req, res) => {
lib.generateToken(req, res) /* /callback - initiates authorization process */
})
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`)
})
/demo
:FAQs
survey monkey oauth authencation.
The npm package survey-monkey-oauth receives a total of 0 weekly downloads. As such, survey-monkey-oauth popularity was classified as not popular.
We found that survey-monkey-oauth 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.