yes please prioritize and also give approaches how to mitigate these vulnerability, in…
- User
yes please prioritize and also give approaches how to mitigate these vulnerability, in some custom module we are using spring mvc how to mitigate these vulnerability with liferay OOTB features also provide approaches.
- Assistant
1 Why these CVEs suddenly show up
After moving from an on-premise 6.2 portal to Liferay DXP 7.4 in the cloud you are:
- Packaging your custom code as OSGi modules but you still depend on Spring MVC / Spring Security / Spring Data Jars.
- Black Duck scans the full container image, so it also inspects:
- The Spring libraries already shipped by Liferay.
- The (older) Spring jars that are shaded or embedded in 3ʳᵈ-party libraries you added yourself.
- As a result you see many duplicates of the same CVE and some “future” or “unknown” entries that are simply finger-print mismatches.
2 Prioritised list (what really matters for a typical Liferay DXP 7.4 stack)
Priority CVE Component Fixed version Exploitability in Liferay 🔴 Critical (RCE) 2022-22965 (Spring4Shell) spring-webmvc ≤ 5.3.17 / 5.2.19 5.3.18 / 5.2.20 Always relevant – classic RCE via data binding 2018-1270 Spring Data Commons 1.13.11, 2.0.6, 2.1.0 RCE but only if you expose Repository REST or custom converters 2018-1272 Spring Data REST 2.6.9, 2.7.5, 3.0.1 idem 2020-5421 Spring Cloud Function 3.1.7, 3.2.3 Only if you run SCF in your bundle 2022-22968 Spring Cloud Gateway 3.0.7, 3.1.1 Rare in Liferay – check reverse proxy modules 🟠 High 2023-20861 / 20863 Spring Framework 5.3.28 / 6.0.10 DoS via PathPattern & ReDoS – reachable via standard controllers 2018-1271 / 1275 spring-webmvc / Spring Security ≥ 5.0.6 Multipart traversal & SpEL injection 2022-22950 / 22971 / 22970 Spring Cloud family see advisories Mostly N/A unless micro-services used 🟡 Medium 2018-1199 / 11039 / 1257 / 15756 Spring Boot Actuator, Binding, OAuth patch in Boot 1.5.14 / 2.0.4 / etc. Relevant only when actuator endpoints are exposed ⚪ Possibly false-positive / future 2024-388xx, 2025-22233, “Unknown” – – Not in NVD – ignore for now 🟤 Low 2016-9878 / 5007 / 1000027 Old Spring / Bouncy Castle fixed years ago Already fixed in Liferay’s bundles 👉 Action rule: If the vulnerable class is not present in your final OSGi container or is overriden by a newer version, the CVE is already mitigated.
3 How to mitigate – 4-layer approach
Layer 1 (Liferay baseline)
- Upgrade to the latest Liferay DXP 7.4 Update / Cumulative Fix Pack – each update contains patched Spring bundles.
./patching-tool.sh auto-discovery ./patching-tool.sh info ./patching-tool.sh install <latest-fix-pack.zip> - Re-start the portal; check the Gogo shell:
lb spring | grep "Resolved" # every Spring bundle should show ≥ 5.3.29
Layer 2 (Dependency governance for custom modules)
For every
*-service,*-webor integration module:Gradle example
plugins { id "com.liferay.plugin" } repositories { mavenCentral() } ext.springVersion = "5.3.30" // or 6.x if you compile for JDK 17+ dependencies { compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.5.0" compileOnly platform("org.springframework:spring-framework-bom:${springVersion}") compileOnly "org.springframework:spring-webmvc" // … other Spring deps // Enforce versions to override transitive old ones constraints { implementation("org.springframework:spring-beans:${springVersion}") { because "Patch Spring4Shell" } … } }Rules
- compileOnly / provided – so the jar is not embedded in the module.
- Use a BOM or if you are on Maven.
- Add a Gradle resolution strategy (
all*.dependencySubstitution) to fail the build if something pulls an outdated Spring jar.
Layer 3 (Configuration hardening)
Even after upgrading, tighten attack surface:
Spring MVC controller hardening
@InitBinder public void binder(WebDataBinder binder) { binder.setDisallowedFields("class.*", "*.class.*", "*.*.class.*"); }Global properties (in
portal-ext.propertiesor system-settings):# Disable dangerous SpEL in data binding spring.mvc.format.use-global-cache=true spring.expression.cache.enabled=true # Ensure multipart config limits spring.servlet.multipart.max-request-size=10MB spring.servlet.multipart.max-file-size=10MBDisable/secure Actuator endpoints (
management.endpoints.web.exposure.include=health,info).Layer 4 (Leverage Liferay OOTB instead of Spring MVC where possible)
Feature Spring way Liferay native & safer Portlet MVC @Controllerwith SpringMVCMVCPortletorRestBuildergenerated*ResourceImplREST API @RestControllerLiferay REST Builder → JAX-RS whiteboard; auto-security, rate-limit Security Spring Security filters Liferay’s AuthVerifier,CSRFToken,OAuth2appsBackground jobs @ScheduledLiferay SchedulerEntryImpl, Dispatch AppConfig application.propertiesConfigurationProvider, System Settings UIMigrating to these reduces the number of external Spring libs you carry, hence fewer CVEs to watch.
4 Concrete next steps checklist ✅
- Check your current Liferay fix-pack level → install the newest.
- Produce an SBOM (
gradle cyclonedxBom) – confirm no Spring ≤ 5.3.17 left. - Clean
build.gradle/pom.xml: use BOM and compileOnly. - Re-run Black Duck; the list should shrink to informational items.
- For the remaining true-positives, apply the Layer 3 hardening snippets.
- Where feasible, plan tech-debt sprint to swap Spring MVC controllers for Liferay REST Builder / MVCPortlet patterns.
Need deeper help?
If you want a script that walks your repo and rewrites old
spring-*.jarversions, or sample code that replaces a Spring MVC controller with an Liferay REST Builder resource, let me know and I’ll include it.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.