How to fix: Sunset date has passed but the endpoint still answers
The response carries an RFC 8594 Sunset header whose date has already passed. The resource is still being served after the retirement date it announced.
Why it matters
A route that outlives its own sunset date is a route nobody owns. It keeps running the code path that was frozen at deprecation, including its authentication and input validation, while review, testing and dependency updates have moved to the replacement. It is also the version an attacker will pick, precisely because it is the one that stopped changing.
Sunset is a promise about a date, and the header still being served past that date means either the removal slipped or the header was never revisited. Both are worth knowing. The check only reads the header; it does not judge whether keeping the endpoint alive was the right call, and a deliberate extension should be reflected by updating the date rather than by leaving a stale one in place.
How to fix it
- 1Decide whether to remove the endpoint or extend it, then make the header say so.
- 2If extending, publish a new Sunset date and tell the callers that are still using it.
- 3If removing, return 410 Gone with a Link rel=successor-version pointing at the replacement, rather than deleting the route silently.
- 4Add a check to CI or to a monitor that alerts when a Sunset date passes while the route is still live.
Code examples
Retire the route properly
router.all('/v1/reports', (req, res) => {
res.set('Link', '</v2/reports>; rel="successor-version"');
res.status(410).json({
error: 'gone',
message: 'v1/reports was retired on 2026-01-01. Use /v2/reports.',
});
});Check a live endpoint
curl -sI https://api.example.com/v1/reports | grep -i -E 'sunset|deprecation|link'References
Detected automatically by VulnRadar. The check id is api-sunset-header-in-past, 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 Sunset date has passed but the endpoint still answers?
- 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-sunset-header-in-past, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Sunset date has passed but the endpoint still answers map to?
- It maps to CWE-1059. In the OWASP Top 10 it falls under A09:2021.
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.