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.
This gem hooks into ActionView::Helpers::AssetTagHelper and provides some asset tags that will replace a local resource with something hosted on a CDN, like Amazon's CloudFront. This is an easy way to use a CDN in your code with only minor effort on your part. Your users will see greatly reduced load time and you'll see happier users.
Add this line to your application's Gemfile:
gem 'cloud_front_helpers'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cloud_front_helpers
Set up an initializer at
./config/initializers/cloud_front_helpers.rb
This initializer should look something like:
AssetTagHelper.configure do |config|
config.cloud_front_url = "https://YOUR_CDN_URL.cloudfront.net" if Rails.env.production?
end
If no initializer exists, your code will still work but it'll just run like normal (off your asset pipeline).
Once you've set up your initializer, including CDN assets has never been simpler. We've included helpers for image, styles, and scripts.
<%= cf_image_tag "/images/foo.png" %>
<%= cf_javascript_include_tag "/javascripts/spaceCats.js" %>
<%= cf_stylesheet_link_tag "/stylesheets/bar.css" %>
In addition to these asset tag helpers, we've included a sass extension for your background and background-image tags. In any stylesheet, put something like this:
.whatever {
background: cf_url("/path/to/some/image.jpg");
}
And that's it!
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that cloud_front_helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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.