
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
A package that distributes Bootstrap Icons in a gem based in GitHub OctIcons gem.
Add this to your Gemfile
$ gem 'bootstrap-icons'
Then bundle install
.
require 'bootstrap-icons'
icon = BootstrapIcons::BootstrapIcon.new('x')
icon.to_svg
# "<svg class=\"bi bi-x\" viewBox=\"0 0 16 16\" fill=\"currentColor\" version=\"1.1\" width=\"1em\" height=\"1em\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M11.854 4.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708-.708l7-7a.5.5 0 0 1 .708 0z\"></path>\n <path fill-rule=\"evenodd\" d=\"M4.146 4.146a.5.5 0 0 0 0 .708l7 7a.5.5 0 0 0 .708-.708l-7-7a.5.5 0 0 0-.708 0z\"></path></svg>"
The BootstrapIcon
class takes two arguments. The first is the symbol of the icon, and the second is a hash of arguments representing html attributes.
symbol
(required)This is the name of the bootstrap icon you want to use. For example check
. Full list of icons
class:
- When setting the class, it will be included in svg class attribute.fill:
- When setting the fill, the icon will be filled to that color.height:
- When setting the height to a number, the icon will scale to that size. If width
isn't set, it will assume the same size of height
.width:
- When setting the width to a number, the icon will scale to that size. If height
isn't set, it will assume the same size of width
If both :width, :height
are passed into the options hash, then the icon will be sized exactly at those dimensions.
If none of them are passed into the options hash, then the icon will be sized to his default size, as described in bootstrap icons usage.
For now it's not possible to set a custom viewBox
value.
Once initialized, you can read a few properties from the icon.
symbol
Returns the string of the symbol name
icon = BootstrapIcons::BootstrapIcon.new('x')
icon.symbol
# "x"
path
Returns the string representation of the path of the icon.
icon = BootstrapIcons::BootstrapIcon.new('x')
icon.path
# "<path fill-rule=\"evenodd\" d=\"M11.854 4.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708-.708l7-7a.5.5 0 0 1 .708 0z\"></path>\n <path fill-rule=\"evenodd\" d=\"M4.146 4.146a.5.5 0 0 0 0 .708l7 7a.5.5 0 0 0 .708-.708l-7-7a.5.5 0 0 0-.708 0z\"></path>"
fill
Returns the icon default color. Note, this doesn't change if you provide a custom color in fill options.
viewBox
Returns the icon default viewBox
value.
options
This is a hash of all the options
that will be added to the output tag.
icon = BootstrapIcons::BootstrapIcon.new('x')
icon.options
# {:class=>"bi bi-x", :viewBox=>"0 0 16 16", :fill=>"currentColor", :version=>"1.1", :width=>"1em", :height=>"1em", :"aria-hidden"=>"true"}
width
/ height
Returns icon true width
/ height
, it the most cases 1em
. Note, this doesn't change if you scale it up with/height size options, it only is the "natural width/height" of the icon.
to_svg
Returns a string of the svg tag
icon = BootstrapIcons::BootstrapIcon.new('x')
icon.to_svg
# "<svg class=\"bi bi-x\" viewBox=\"0 0 16 16\" fill=\"currentColor\" version=\"1.1\" width=\"1em\" height=\"1em\" aria-hidden=\"true\"><path fill-rule=\"evenodd\" d=\"M11.854 4.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708-.708l7-7a.5.5 0 0 1 .708 0z\"></path>\n <path fill-rule=\"evenodd\" d=\"M4.146 4.146a.5.5 0 0 0 0 .708l7 7a.5.5 0 0 0 .708-.708l-7-7a.5.5 0 0 0-.708 0z\"></path></svg>"
FAQs
Unknown package
We found that bootstrap-icons 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.