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.
Simple asynchronous MySQL ORM class.
pip3 install aio_ormsql
pip3 install asyncio aiomysql
from aio_ormsql.db import DataBase
from aio_ormsql.classes Table, Column, WHERE
Where:
DataBase
- class for working with MySQLTable
- class for creating a new tableColumn
- class for creating a columnsWHERE
- class for creating where statementstbl = Table(
'tests',
Column('id', int),
Column('tname', str)
)
db = DataBase('admin', 'admin', 'tests')
await db.connect()
where = WHERE(
tbl.tname == 'admin'
)
print(where)
# Output:
# WHERE `tname`='admin'
where2 = WHERE(
(tbl.id >= 20) | (tbl.tname == 'admin')
)
print(where2)
# Output:
# WHERE `id`>=20 OR `tname`='admin'
statement = await db.select(
[tbl.id, tbl.tname], where=where, table=tbl, back=True
)
print(statement)
# Output:
# SELECT DISTINCT `id`, `tname` FROM `tests` WHERE `tname`='admin'
statement2 = await db.select(
[tbl.id, tbl.tname], False, where2, table=tbl, back=True
)
print(statement2)
# Output:
# SELECT`id`, `tname` FROM `tests` WHERE `id`>=20 OR `tname`='admin'
statement3 = await db.insert(
{
tbl.id: 123,
tbl.tname: 'Johan'
},
tbl,
back=True
)
print(statement3)
# Output:
# INSERT INTO `tests` (`id`, `tname`) VALUES (123, 'Johan')
statement4 = await db.update(
{
tbl.id: '123',
tbl.tname: 'Admin'
},
WHERE(tbl.tname == 'Johan'),
tbl,
back=True
)
print(statement4)
# Output:
# UPDATE `tests` SET `id`=123, `tname`='Admin' WHERE `tname`='Johan'
array = db.fetch_gen(await db.select(
[tbl.id, tbl.tname], back=True
))
async for item in array:
print('New pair:', item)
# And you can see row-by-row output
await db.close()
FAQs
Simple asynchronous MySQL ORM class.
We found that aio-ormsql demonstrated a healthy version release cadence and project activity because the last version was released less than 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.