Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A framework agnostic packaging solution to speed up loading times on the client side by using the following techniques:
gem install bagger
require 'bagger'
require 'fileutils'
# define source and target directories
target_dir = "/tmp/bundled_assets"
source_dir = "/applications/my_app/public"
# customize paths for file and cache manifest
manifest_path = File.join(target_dir, 'file_manifest.json') # defaults to manifest.json
cache_manifest_path = 'cache/cache.manifest' # defaults to cache.manifest
# list the stylesheets and javascripts to be combined
# and minified. The order is important, because otherwhise
# the behavior of the stylesheets and javascripts might change
stylesheets = ["css/style.css", "css/reset.css"]
javascripts = ["js/app.js", "js/utils.js"]
# define cache manifest bundles for different devices
# for convenience, the manifest defined with `cache_manifest_path`
# will always contain all resources
ipad_resources = ["images/troll-big.png"]
iphone_retina_resources = ["images/troll-retina.png"]
desktop_browser_resources = ["images/troll.png"]
# make sure the target directory exists
FileUtils.mkdir_p target_dir
# define the options hash
options = {
:source_dir => source_dir,
:target_dir => target_dir,
:manifest_path => manifest_path,
:gzip => false,
:verbose => false,
:cache_manifest_path => cache_manifest_path,
:path_prefix => '',
:css_path_prefix => '',
:exclude_pattern => /.*\.less/,
:exclude_files => [ 'css/main.sass', 'css/style.sass' ]
:combine => {
:stylesheets => [
{
:target_path => 'css/all.css',
:files => stylesheets
}
],
:javascripts => [
{
:target_path => 'js/combined.js',
:files => javascripts
}
]
},
:cache_manifests => [
{
:target_path => 'cache/ipad-cache.manifest',
:files => ipad_resources
},
{
:target_path => 'cache/retina-cache.manifest',
:files => iphone_retina_resources
},
{
:target_path => 'cache/desktop.manifest',
:files => desktop_browser_resources
}
]
}
# run it
Bagger::bagit!(options)
manifest_path = File.join(target_dir, 'manifest.json')
cache_manifest_path = File.join(target_dir, 'cache.json')
{
"/css/all.css" : "/css/all.19db9a16e2b73017c575570de577d103.css",
"/js/combined.js" : "/js/combined.19db9a16e2b73017c575570de577d103.js",
"/images/logo.png" : "/images/logo.19db9a16e2b73017c575570de577d103.png"
}
CACHE MANIFEST
# Explicitely cached entries
/css/all.19db9a16e2b73017c575570de577d103.css
/js/combined.19db9a16e2b73017c575570de577d103.js
/images/logo.19db9a16e2b73017c575570de577d103.png
NETWORK:
*
check the build status on travis.ci
FAQs
Unknown package
We found that bagger 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.