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.
xmlhasher_with_attributes
Advanced tools
Fast XML to Ruby Hash converter
This gem is a fork of a fork of XmlHasher (through pawelma). Regarding the original code, there's only one difference : it does not skip attributes if only content is provided. I did the work to publish the gem on rubygems.org with a different name to make it available.
Example:
XmlHasher.parse('<tag attribute="attr_val">content</tag>')
# In original xmlhasher above command will return following hash:
{
tag: "content"
}
# With xmlhasher_with_attributes hash will be equal:
{
tag: {
attribute: "attr_val",
value: "content"
}
}
bundle install
rake install
require 'xmlhasher_with_attributes'
require 'xmlhasher_with_attributes'
# XmlHasher global configuration
#
# snakecase - convert all keys to snake case notation
# ignore_namespaces - remove XML namespaces
# string_keys - represent keys as Strings instead of Symbols
#
# here is default configuration
XmlHasher.configure do |config|
config.snakecase = true
config.ignore_namespaces = true
config.string_keys = false
end
# alternatively, specify configuration options when instantiating a Parser
parser = XmlHasher::Parser.new(
:snakecase => true,
:ignore_namespaces => true
:string_keys => false
)
# by default, XmlHasher will convert all keys to symbols. If you want all keys to be Strings, set :string_keys option to 'true'
# parse XML file
XmlHasher.parse(File.new('/path/to/my/file.xml'))
# parse XML string
XmlHasher.parse("<tag1><tag2>content</tag2></tag1>")
# => {:tag1=>{:tag2=>"content"}}
Copyright (c) 2013 Gene Drabkin. See LICENSE for details.
FAQs
Unknown package
We found that xmlhasher_with_attributes 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.