
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
fastify-xml-body-parser
Advanced tools
Fastify plugin / module to parse XML payload / body into JS object
$npm install fastify-xml-body-parser
#or
$yarn add fastify-xml-body-parser
Sample POST body / payload
<sample>data</sample>
const fastify = require('fastify')()
fastify.register(require('fastify-xml-body-parser'))
fastify.post('/', (req, reply) => {
console.log(req.body.sample)//data
reply.send(req.body)
})
fastify.listen(8000, (err) => {
if (err) throw err
})
The sent reply would be the object:
{
sample: 'data'
}
This plugin use fast-xml-parser to parse the XML payload. So it accepts all the options supported by fast-xml-parser.
var options = {
commentPropName: "#comment",
preserveOrder: true
};
const fastify = require('fastify')()
fastify.register(require('fastify-xml-body-parser'), options)
Additionaly, it supports following options
true
, this plugin validate the payload for valid XML syntax before parsing.["text/xml", "application/xml", "application/rss+xml"]
.Note: I've not included body size limit to this plugin because of following reasons
Tian
.FAQs
Fastify plugin to parse XML payload into JS object
We found that fastify-xml-body-parser 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
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.