Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Create SQL statements using Hashes. (Currently only supports SELECT statements.)
Add this line to your application's Gemfile:
gem 'hash_sql'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hash_sql
# Basic query
# Will produce:
# SELECT UID,profile.firstName,profile.lastName,profile.email
# FROM accounts
# WHERE profile.email='test05@mailinator.com'
# AND (profile.firstName='Five' AND profile.lastName='Zero')
#
query = HashSql.select_statement(:accounts,
fields: ['UID', 'profile.firstName', 'profile.lastName', 'profile.email'],
filter: {
"profile.email" => "='test05@mailinator.com'",
and: { "profile.firstName" => "='Five'", "profile.lastName" => "='Zero'" }
}
)
# Nested conditions
# Will produce:
# SELECT UID,profile.firstName,profile.lastName,profile.email
# FROM accounts
# WHERE profile.email='test05@mailinator.com'
# AND (profile.firstName='Five'
# OR (profile.lastName='Zero' AND isActive=true))
#
query = HashSql.select_statement(:accounts,
fields: ['UID', 'profile.firstName', 'profile.lastName', 'profile.email'],
filter: {
"profile.email" => "='test05@mailinator.com'",
and: { "profile.firstName" => "='Five'", or: { "profile.lastName" => "='Zero'", and: { "isActive" => "=true" } } }
}
)
The filter to use for searching accounts. The key is the field name to set the filter on, and the value is the concatenation of the operator to use for comparison and the value used for comparing. Example:
{ email: "='test@abc.com'"}
The logical operations between filters can be AND or OR and the it could be set by setting the key to either "and:" or "or:" Example:
{ email: "='test@abc.com", and: {firstname: "='Nick'"} }
Will be translated to: email='test@abc.com' AND firstname = 'Nick'
If multiple entries are placed inside an "and:" or "or:" they will "ANDed" or "ORed" together. Example:
{ email: "='test@abc.com", and: {firstname: "='Nick'", lastname: "='DS'"} }
Will be translated to email='test@abc.com' AND (firstname = 'Nick' AND lastname = 'DS')
Example:
{ email: "='test@abc.com", or: {firstname: "='Nick'", lastname: "='DS'"} }
Will be translated to email='test@abc.com' OR (firstname = 'Nick' OR lastname = 'DS')
Example:
{ email: "='test@abc.com", and: {firstname: "='Nick'", or: {lastname: "='DS'"}} }
Will be translated to email='test@abc.com' AND (firstname = 'Nick' OR lastname = 'DS')
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that hash_sql 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.