Scan your whole stack
From OX Research Newsroom
Are you using @fastify/accepts-serializer?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v6.0.6
@fastify/accepts-serializer was last scanned on 9 Oct 2026 at version 6.0.6. Risk score 5 of 100 (low). No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 6.0.6 LATEST | 9 Oct 2026 | 1 rule fired |
| 6.0.5 | 12 Aug 2026 | No rules fired |
Findings for v6.0.6. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The package's maintainer or owner differs from the previous version. This is usually benign, such as a transfer or reorganization, but account takeovers look the same at first. Shown for awareness.
LOWThe score describes 6.0.6; other versions have their own rules, not their own score.
0 CRITICAL 1 HIGH 0 MEDIUM 0 LOW
The publisher’s own README, as collected from the registry.
Serialize according to the Accept header.
npm i @fastify/accepts-serializer
| Plugin version | Fastify version |
|---|---|
>=6.x |
^5.x |
^5.x |
^4.x |
>=3.x <5.x |
^3.x |
^2.x |
^2.x |
^1.x |
^1.x |
Please note that if a Fastify version is out of support, then so are the corresponding versions of this plugin in the table above. See Fastify's LTS policy for more details.
const protobuf = require('protobufjs')
const YAML = require('yamljs')
const msgpack = require('msgpack5')()
const root = protobuf.loadSync('test/awesome.proto')
const AwesomeMessage = root.lookupType('awesomepackage.AwesomeMessage')
const fastify = require('fastify')()
// Global serializers
fastify.register(require('@fastify/accepts-serializer'), {
serializers: [
{
regex: /^application\/yaml$/,
serializer: body => YAML.stringify(body)
},
{
regex: /^application\/x-msgpack$/,
serializer: body => msgpack.encode(body)
}
],
default: 'application/yaml', // MIME type used if Accept header does not match anything
cacheSize: 100 // max number of Accept header combinations to cache (default: 100)
})
// Per-router serializers
const config = {
serializers: [
{
regex: /^application\/x-protobuf$/,
serializer: body => AwesomeMessage.encode(AwesomeMessage.create(body)).finish()
}
]
}
fastify.get('/request', { config }, function (req, reply) {
reply.send({pippo: 'pluto'})
})
| Option | Type | Default | Description |
|---|---|---|---|
serializers |
Array |
[] |
List of serializer definitions, each with a regex and a serializer function |
default |
string |
— | MIME type to use when no serializer matches the Accept header. If omitted, unmatched requests receive a 406 response |
cacheSize |
number |
100 |
Maximum number of distinct Accept header combinations to cache. Entries are evicted in LRU order once the limit is reached |
For each route, a SerializerManager is defined, which has both per-route and global serializer definitions.
The MIME type application/json is always handled by fastify if no serializer is registered for that MIME type.
If no default key is specified in configuration, all requests with an unknown Accept header will be replied to with a 406 response (a boom error is used).
Serializer selection results are cached by Accept header value using an LRU cache bounded by cacheSize. This prevents unbounded memory growth from attacker-controlled Accept header variants.
Licensed under MIT.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.