Repository navigation
fix: correct expiry of NODEAUDIT/CENTRAL/POM caches by ensuring values inherit from default region - #8865
Merged
Conversation
… region Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The persisted JCS expiry rewrite, including vulnerability results, needs restart-test and real pre-fix cache upgrade validation because serialization and asynchronous disk-write behavior cannot be verified in this snapshot.
No open issues 🎉
What changed in this PR
Fixes #8757 by restoring intended expiration for the CENTRAL, POM, and NODEAUDIT caches, while preserving legacy entries that are still within their configured lifetime.
Changes:
- Centralizes cache defaults in properties so regions inherit non-eternal expiration settings.
- Repairs legacy eternal entries on access, preserving creation times and removing expired entries.
- Adds disk-backed regression tests for policy inheritance, restart persistence, and legacy-entry repair.
| File | Description |
|---|---|
| core/src/test/java/org/owasp/dependencycheck/data/cache/DataCacheFactoryTest.java | Adds expiration, persistence, and legacy-cache regression tests. |
| core/src/main/resources/dependencycheck-cache.properties | Consolidates inherited defaults and retains region-specific lifetimes. |
| core/src/main/java/org/owasp/dependencycheck/data/cache/DataCacheFactory.java | Refactors initialization and removes programmatic region overrides. |
| core/src/main/java/org/owasp/dependencycheck/data/cache/DataCache.java | Reconciles legacy eternal entries with the region’s expiration policy. |
Review effort: Balanced
jeremylong
approved these changes
Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Currently JCS caches are not expiring correctly because the elements are being set to
Eternalwhich overrides the max lifetime entries that are being set.This means node audit, central and POM results are being cached indefinitely, far longer than originally intended. For node audit this means false negatives and positives. For central and its POM perhaps no real effect as POMs should be immutable and the central results for a SHA search shouldn't really be changing, except when multiple artifacts match.
This was happening because the programmatic logic was overriding the default region attributes entirely. This change
.properties"default" configuration which caused this issueRelated issues
Have test cases been added to cover the new functionality?
yes