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.
Interesting twist of ruby language: YAML contains fragments of ruby, that can be composed. Compiles to ruby. Art of true metaprogramming and code generation.
Add this line to your application's Gemfile:
gem 'wateruby'
And then execute:
$ bundle
Or install it yourself as:
$ gem install wateruby
Create hello.wateruby
:
language: ruby
body:
- puts "Hello, World"
Compiling to ruby:
$ wateruby hello.wateruby > hello.rb
Running ruby:
$ ruby hello.rb
Hello, World
language: ruby
definitions:
Greeter:
define: class <%= name %> < Struct.new(:greeting)
definitions:
greet:
define: def <%= name %>(name)
body:
- "#{greeting}, #{name}!"
body:
- puts Greeter.new("hello").greet("world")
This is required when you are dealing with decorators for almost all methods in your system: they need to be ridicuously light - this makes method call cost very relevant, so you want to have as least as possible of them.
language: ruby
definitions:
Contract:
define: class <%= name %>
definitions:
self.make_validator:
define: def <%= name %>(contract)
body:
- klass = contract.class
- |
<%= inline("self.proc_contract", contract, klass) %> ||
<%= inline("self.array_contract", contract, klass) %> ||
<%= inline("self.hash_contract", contract, klass) %> ||
<%= inline("self.args_contract", contract, klass) %> ||
<%= inline("self.func_contract", contract, klass) %> ||
<%= inline("self.default_contract", contract, klass) %>
self.proc_contract:
# e.g. lambda {true}
inlinable: true
define: def <%= name %>(contract, its_klass)
pre: its_klass == Proc
body: contract
self.array_contract:
# e.g. [Num, String]
# TODO: account for these errors too
inlinable: true
define: def <%= name %>(contract, its_klass)
pre: klass == Array
body: |
lambda do |arg|
return false unless arg.is_a?(Array) && arg.length == contract.length
arg.zip(contract).all? do |_arg, _contract|
Contract.valid?(_arg, _contract)
end
end
# and so on..
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that wateruby 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.