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.
github.com/jasperalani/mysql-query-builder
Functions that take values and return SQL ready to be queried.
In the future:
select
insert
update
delete
condition.where
Javascript:
let query = ''
queryBuilder.select(['id', 'name'], 'my_table', 'id = 6');
queryBuilder.select(['id', 'name'], 'my_table', condition.where('id', '6', '='));
// SELECT id, name FROM `my_table` WHERE id = 6;
queryBuilder.insert(['name', 'deleted'], ['Jasper', false], 'my_table');
// INSERT INTO `my_table` (name, deleted) VALUES ('Jasper', 'false');
queryBuilder.update(['name', 'deleted'], ['Yasper', true], 'id = 6', 'my_table');
// UPDATE `my_table` SET name = 'Yasper', deleted = 'true' WHERE id = 6;
queryBuilder.delete('id = 6', 'my_table');
// DELETE FROM `my_table` WHERE id = 6;
queryBuilder.select(
'*',
'table',
// condtion funtion
condition.where(['id', 'code'], ['5', 'xxyyzz'], '=')
)
// SELECT * FROM `table` WHERE id = 5 AND code = 'xxyyzz';
Typescript:
const columns: Columns = {
columns: [
{value: 'id'},
{value: 'name'},
{value: 'deleted'}
]
}
const values: Values = {
values: [
{value: 6},
{value: 'value'},
{value: false}
]
}
queryBuilder.insert(columns, values, 'my_table');
queryBuilder.select(columns, 'my_table', 'id = 6');
queryBuilder.update(columns, values, 'id = 6', 'my_table');
queryBuilder.delete('id = 6', 'my_table');
PHP:
$builder = new QueryBuilder();
$select = $builder->select( [ 'column1', 'column2' ], 'table1', 'x = 6' );
$insert = $builder->insert( [ 'column1' ], ['value1'], 'table1' );
$update = $builder->update( [ 'column1', 'column2' ], ['value1', 'value2'], 'table1', 'x = 6' );
$delete = $builder->delete( 'table1', 'x = 6' );
FAQs
Unknown package
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.