How to fix: API reports itself deprecated without a Deprecation/Sunset header
A JSON API response explicitly reports itself as deprecated, a deprecated: true field, or a status/message field saying so, but the HTTP response carries neither the standard Deprecation nor Sunset header.
Why it matters
Without the standard headers, API gateways, generated client SDKs, and monitoring tooling that watch for RFC 8594/9745 deprecation signals have no machine-readable way to detect and alert on the deprecation. Only a developer who happens to read the response body notices, so integrations keep shipping against an endpoint on its way out with no advance warning built into their tooling.
Gated on the response actually being JSON-shaped (an application/json content type, or a body that starts with { or [), so an ordinary HTML documentation page whose prose happens to mention deprecation does not trigger this.
How to fix it
- 1Add a Deprecation response header (RFC 9745), either Deprecation: true or a deprecation date, alongside the existing in-body notice
- 2Add a Sunset response header (RFC 8594) with the planned removal date once one is set
- 3Keep the in-body notice too so it stays visible to callers who don't inspect headers
Code examples
Express: RFC-compliant deprecation headers
router.get('/v1/users', (req, res) => {
res.set('Deprecation', 'true');
res.set('Sunset', 'Wed, 01 Apr 2026 00:00:00 GMT');
res.set('Link', '</v2/users>; rel="successor-version"');
res.json({ deprecated: true, data: getUsersV1() });
});References
Detected automatically by VulnRadar. The check id is api-deprecation-header-missing, stable across every scan so you can filter or diff on it.
More api checks
- LowTRACE method referenced in API response body
- InfoREST endpoint allows DELETE
- LowGraphQL introspection field suggestions
- MediumGraphQL endpoint has no rate-limit headers
- LowOpenAPI server URL leaks internal host
- LowCORS preflight result not cached
- HighBearer token in URL query string
- MediumJSONP callback parameter accepted
Questions
- How severe is API reports itself deprecated without a Deprecation/Sunset header?
- VulnRadar rates this low severity in the api category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id api-deprecation-header-missing, which stays the same between runs so you can filter, diff, or gate CI on it.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.