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.
SQB is a lightweight, multi-dialect SQL query builder for JavaScript;
Note: SQB is in alpha state. Use it only for testing purposes only!
const sqb = require('./'),
and = sqb.and,
or = sqb.or,
innerJoin = sqb.innerJoin,
select = sqb.select,
raw = sqb.raw;
let sql =
select(
'b.ID as book_id', 'b.name book_name', 'c.name category_name',
select(raw('count(*)')).from('articles a')
.where(and('a.book_id', '=', raw("b.id"))).alias('article_count')
)
.from('BOOKS b')
.join(
innerJoin('category c')
.on(and('c.id', '=', raw('b.category_id')), and('c.kind', 'science'))
)
.where(
and('name', 'like', /name/),
and([
or('release_date', 'between', /release_date/),
or('release_date', 'between', new Date(2015, 0, 1, 0, 0, 0, 0), new Date(2016, 0, 1, 0, 0, 0, 0)),
]),
and([
or('c.name', '=', 'novel'),
or('c.name', '=', 'horror'),
or('c.name', '=', 'child'),
or(select('name').from('category').where(and('id', 5)))
])
)
.orderBy("c.name", "b.release_date desc");
SQL output
select b.ID book_id, b.name book_name, c.name category_name,
(select count(*) from articles a where a.book_id = b.id) article_count
from BOOKS b
inner join category c on c.id = b.category_id and c.kind = 'science'
where name like ? and (release_date between ? and ?
or release_date between '2015-01-01' and '2016-01-01')
and (c.name = 'novel' or c.name = 'horror' or c.name = 'child'
or (select name from category where id = 5) = null)
order by c.name, b.release_date desc
Paremeters output
[ 'WHTE DOG', 2000-01-01T00:00:00.000Z, 2001-01-01T00:00:00.000Z ]
>= 6.x
;FAQs
Extensible, multi-dialect SQL query builder and Database connection framework for JavaScript
The npm package sqb receives a total of 192 weekly downloads. As such, sqb popularity was classified as not popular.
We found that sqb 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.