Commit Graph

1765 Commits

Author SHA1 Message Date
Lukasz Lenart a1c8af5574 WW-5666 Apply input length limits consistently when reading request bodies (6.x) (#1822)
* WW-5666 fix(json): apply the input length limit while reading

* WW-5666 fix(core): bound the CSP report body read and make the limit configurable

CspReportAction read the submitted report body with a single readLine() and had
no limit of its own. Read it up to a limit instead, defaulting to 8192
characters and configurable through struts.csp.report.maxSize. A body above the
limit is discarded with a warning rather than processed.

The limit is injected when the action is built, before the interceptor stack
runs, because withServletRequest is invoked by the servletConfig interceptor
ahead of staticParams and params. Values that are not usable as a buffer size
are ignored with a warning.
2026-08-01 10:04:57 +02:00
Lukasz Lenart f8d42eb023 Prepare for a new development cycle of Struts 6.11.0 (#1739)
* [maven-release-plugin] prepare release STRUTS_6_10_0

* [maven-release-plugin] prepare for next development iteration
2026-06-14 07:39:08 +00:00
Lukasz Lenart 0db282a51a pom(version): sets proper SNAPSHOT version (#1709) 2026-05-25 15:04:31 +00:00
Lukasz Lenart ca1b22d9be Struts 6.9.0 (#1662)
* [maven-release-plugin] prepare release STRUTS_6_9_0

* [maven-release-plugin] prepare for next development iteration
2026-05-01 10:41:26 +02:00
Lukasz Lenart b936fcbf8b WW-5621 Harden XML parsers against Entity Expansion (Billion Laughs) attacks (#1643)
Backport of apache/struts#1642 from Struts 7 to Struts 6.

Modern JDKs (7u45+) already protect against this attack with a built-in
64K entity expansion limit. These changes add defense-in-depth hardening
and remove unnecessary attack surface.

- Enable FEATURE_SECURE_PROCESSING in DomHelper SAX parser
- Enable FEATURE_SECURE_PROCESSING in DigesterDefinitionsReader
- Remove unused parseStringAsXML feature from StringAdapter to eliminate
  a theoretical XML Entity Expansion vector
- Deprecate setParseStringAsXML() and getParseStringAsXML() for removal
- Add Billion Laughs protection tests for DomHelper and DigesterDefinitionsReader

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 11:20:47 +02:00
Lukasz Lenart 0a8b111e36 WW-5537 fix(core): resolve classloader/memory leaks during Tomcat hot deployment (#1631)
* WW-5537 fix(core): resolve classloader/memory leaks during Tomcat hot deployment

Introduce InternalDestroyable interface with container-based discovery to
clean up static caches, daemon threads, and shared references that pin the
webapp classloader after undeploy. This prevents OutOfMemoryError (Metaspace)
on repeated hot deployments.

Changes:
- Add InternalDestroyable/ContextAwareDestroyable interfaces for cleanup hooks
- Clear OGNL, Component, ScopeInterceptor, DefaultFileManager static caches
- Stop FinalizableReferenceQueue daemon thread and null its classloader
- Clear FreeMarker template/introspection caches from ServletContext
- Replace ContainerHolder ThreadLocal with volatile to prevent thread-pool leaks
- Clear static dispatcherListeners list on Dispatcher cleanup
- Add JSONCacheDestroyable for json plugin cache cleanup
- Register all destroyables via struts-beans.xml / struts-plugin.xml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* WW-5537 chore(showcase): add log4j-web for proper Log4j2 lifecycle in Servlet container

Without log4j-web, Log4j2 SoftReferences delay classloader GC after undeploy.
The log4j-web module provides Log4jServletContextListener which ensures proper
Log4j2 shutdown during ServletContext destruction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* WW-5537 fix(core): use ThreadLocal with generation counter in ContainerHolder

Replace the volatile shared reference with a ThreadLocal backed by a volatile
generation counter. Per-request clear() only affects the current thread (safe
for concurrent requests and tests). On undeploy, invalidateAll() advances the
generation counter so idle pool threads detect staleness on next access and
self-clear, preventing classloader leaks without breaking test isolation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 07:17:44 +02:00
Lukasz Lenart f644ea54e2 WW-5618 feat(json): add configurable limits to JSON plugin for DoS prevention (#1626)
Add configurable limits to the JSON plugin to prevent denial-of-service
attacks via malicious JSON payloads. Limits are enforced directly in the
existing JSONReader class without breaking backward compatibility (no
interface extraction or class renames).

New configurable constants (struts-plugin.xml defaults):
- struts.json.maxElements (10000) - per-container element count
- struts.json.maxDepth (64) - maximum nesting depth
- struts.json.maxLength (2097152) - maximum input length in chars
- struts.json.maxStringLength (262144) - maximum string value length
- struts.json.maxKeyLength (512) - maximum object key length

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 12:11:22 +01:00
Lukasz Lenart bfebc3e4a1 WW-4428 feat(json): add java.time serialization and deserialization support (#1616)
- Add serialization support for LocalDate, LocalDateTime, LocalTime,
  ZonedDateTime, OffsetDateTime, and Instant in DefaultJSONWriter
- Add deserialization support for the same types in JSONPopulator
- Support @JSON(format=...) custom formats for all temporal types
- Add Calendar deserialization support (was serialize-only)
- Add comprehensive tests including custom formats, null handling,
  malformed input, and round-trip serialization/deserialization

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 08:43:08 +01:00
Lukasz Lenart edd604a9c5 Sets a proper SNAPSHOT version before next release (#1615) 2026-03-09 10:24:37 +01:00
Lukasz Lenart 4b2915682d fix(convention): WW-4421 detect duplicate @Action names when execute() is annotated (#1590)
The duplicate @Action name detection in PackageBasedActionConfigBuilder
was embedded inside a conditional block that only ran when execute() was
NOT annotated with @Action. This meant two methods could map to the same
action name silently when execute() had an @Action annotation, with one
overwriting the other non-deterministically.

Extract the duplicate check to run unconditionally before the conditional
block, so it applies to all annotated methods regardless of whether
execute() is annotated.

Backport of apache/struts#1579 from Struts 7.x to 6.x.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-21 18:18:27 +01:00
Lukasz Lenart 122dec4d73 feat(conversion): WW-4291 allow Spring bean names for type converters (#1564)
Implement two-phase processing for conversion properties to enable
Spring bean name resolution in struts-conversion.properties files.

The issue was a timing problem: type converters were processed during
bootstrap phase before SpringObjectFactory was available. Now:
- Early phase: process struts-default-conversion.properties (class names)
- Late phase: process user properties when SpringObjectFactory is ready

Changes:
- Add UserConversionPropertiesProvider interface for late initialization
- Add UserConversionPropertiesProcessor to trigger late phase processing
- Split StrutsConversionPropertiesProcessor.init() into early/late phases
- Register new beans in DefaultConfiguration and struts-beans.xml
- Add alias in StrutsBeanSelectionProvider for dependency injection
- Improve JavaDocs for BeanSelectionProvider classes

Closes WW-4291

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-06 07:44:06 +01:00
dependabot[bot] d955721e17 build(deps): bump org.codehaus.mojo:exec-maven-plugin (#1509)
Bumps [org.codehaus.mojo:exec-maven-plugin](https://github.com/mojohaus/exec-maven-plugin) from 3.6.2 to 3.6.3.
- [Release notes](https://github.com/mojohaus/exec-maven-plugin/releases)
- [Commits](https://github.com/mojohaus/exec-maven-plugin/compare/3.6.2...3.6.3)

---
updated-dependencies:
- dependency-name: org.codehaus.mojo:exec-maven-plugin
  dependency-version: 3.6.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-12 18:41:04 +01:00
dependabot[bot] 5d648a62bf Bump org.apache.rat:apache-rat-plugin from 0.15 to 0.17 (#1436)
* Bump org.apache.rat:apache-rat-plugin from 0.15 to 0.17

Bumps org.apache.rat:apache-rat-plugin from 0.15 to 0.17.

---
updated-dependencies:
- dependency-name: org.apache.rat:apache-rat-plugin
  dependency-version: '0.17'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Updates exclusions

* Cleans up files with missing header

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lukasz Lenart <lukaszlenart@apache.org>
2025-12-07 09:33:05 +01:00
dependabot[bot] 52dba77dc0 Bump org.jfree:jfreechart from 1.5.5 to 1.5.6 (#1440)
Bumps [org.jfree:jfreechart](https://github.com/jfree/jfreechart) from 1.5.5 to 1.5.6.
- [Release notes](https://github.com/jfree/jfreechart/releases)
- [Commits](https://github.com/jfree/jfreechart/compare/v1.5.5...v1.5.6)

---
updated-dependencies:
- dependency-name: org.jfree:jfreechart
  dependency-version: 1.5.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-01 06:55:32 +01:00
Lukasz Lenart cae08102d5 Removes unused jaxb-core dependency (#1434) 2025-11-28 08:44:15 +01:00
dependabot[bot] a810da1397 Bump com.sun.xml.bind:jaxb-core from 2.3.0.1 to 4.0.6 (#1429)
Bumps com.sun.xml.bind:jaxb-core from 2.3.0.1 to 4.0.6.

---
updated-dependencies:
- dependency-name: com.sun.xml.bind:jaxb-core
  dependency-version: 4.0.6
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-26 19:07:26 +01:00
dependabot[bot] 7003406d4c Bump org.codehaus.mojo:exec-maven-plugin from 3.4.1 to 3.6.2 (#1411)
Bumps [org.codehaus.mojo:exec-maven-plugin](https://github.com/mojohaus/exec-maven-plugin) from 3.4.1 to 3.6.2.
- [Release notes](https://github.com/mojohaus/exec-maven-plugin/releases)
- [Commits](https://github.com/mojohaus/exec-maven-plugin/compare/3.4.1...3.6.2)

---
updated-dependencies:
- dependency-name: org.codehaus.mojo:exec-maven-plugin
  dependency-version: 3.6.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-17 07:56:47 +01:00
Lukasz Lenart 34e279e6d7 [maven-release-plugin] prepare for next development iteration 2025-09-15 07:46:27 +02:00
Lukasz Lenart 80225c7169 [maven-release-plugin] prepare release STRUTS_6_8_0 2025-09-15 07:46:18 +02:00
Lukasz Lenart 6b2de2df4a WW-5504 Allows to use request instead of session attribute to store nonce (#1174) 2025-09-15 07:13:24 +02:00
Lukasz Lenart 0f61944d64 WW-5544 Marks ReflectionContextFactory as deprecated and uses ActionContext instead (#1254) 2025-04-27 15:59:19 +02:00
Lukasz Lenart ca4e07cead [maven-release-plugin] prepare for next development iteration 2025-02-20 13:20:56 +01:00
Lukasz Lenart 8fb9aba74b [maven-release-plugin] prepare release STRUTS_6_7_4 2025-02-20 13:20:46 +01:00
Lukasz Lenart 87e322dbe2 [maven-release-plugin] prepare for next development iteration 2025-02-17 11:34:19 +01:00
Lukasz Lenart 7909f43237 [maven-release-plugin] prepare release STRUTS_6_7_3 2025-02-17 11:34:11 +01:00
Lukasz Lenart d35ec15c76 WW-5525 Fixes NPE when checking if expressions is acceptable
(cherry picked from commit 9fee06cea0)
2025-02-17 18:57:27 +11:00
Kusal Kithul-Godage 583b174fe6 WW-5525 Fix NPE in ProxyUtil for SecurityMemberAccess originating static members 2025-02-17 18:57:27 +11:00
Lukasz Lenart 9b044377ac WW-5501 Reverts all changes related to WW-5501 (#1218)
* Reverts all changes related to WW-5501

* Fixes CodeQL scan by using proper versions of actions

* WW-5501 Uses FilenameUtils instead of a custom code
2025-02-16 12:05:49 +01:00
Kusal Kithul-Godage fe3dd6ba9f WW-5528 Ensure multipart upload illegal characters reported as error 2025-02-07 12:40:42 +11:00
Lukasz Lenart 7a77c7a82c [maven-release-plugin] prepare for next development iteration 2025-02-04 07:39:44 +01:00
Lukasz Lenart 5038a9209f [maven-release-plugin] prepare release STRUTS_6_7_2 2025-02-04 07:39:35 +01:00
Lukasz Lenart 2135ebf651 WW-5501 Ignores DMI related action field (#1211) 2025-02-04 06:47:43 +01:00
Lukasz Lenart 07603b9591 [maven-release-plugin] prepare for next development iteration 2025-02-02 10:16:30 +01:00
Lukasz Lenart 3227d5929a [maven-release-plugin] prepare release STRUTS_6_7_1 2025-02-02 10:16:20 +01:00
Lukasz Lenart 6de93e77db Defines proper snapshot version 2025-01-24 07:58:39 +01:00
Lukasz Lenart 60a3db0a63 Sets version to 6.7.1-SNAPSHOT to prepare for another development cycle 2024-12-18 14:43:29 +01:00
Lukasz Lenart 1f5305c249 [maven-release-plugin] prepare release STRUTS_6_7_0 2024-11-17 10:57:09 +01:00
Lukasz Lenart 8a2f494c12 WW-5484 Marks the DWR plugin as deprecated 2024-11-11 17:49:54 +01:00
Kusal Kithul-Godage 6fbd9e5321 WW-3714 Ensure correct delegation of new Result API 2024-11-03 11:26:14 +11:00
Kusal Kithul-Godage 1908cbab8f Merge pull request #1105 from apache/WW-5476-defaultresultfactory
WW-5478 Deprecate DefaultResultFactory
2024-11-02 14:05:37 +11:00
Kusal Kithul-Godage fe46ad9f4a WW-5478 Deprecate DefaultResultFactory 2024-11-02 14:01:36 +11:00
Kusal Kithul-Godage 7cdcd84b83 Merge pull request #1072 from apache/fix/WW-5468-modeldriven-2
WW-5468 Exempt ModelDriven Actions from @StrutsParameter requirement
2024-11-01 19:17:21 +11:00
Lukasz Lenart 67e0477993 WW-5476 Deprecates tag's parameters as replaced with attributes 2024-10-25 08:28:18 +02:00
Kusal Kithul-Godage 2757c23572 WW-3714 Fix replacement ValidationAware marker not recognised 2024-10-22 17:01:57 +11:00
Kusal Kithul-Godage ebedd7391f WW-3714 Marker interface migration follow-up 2024-10-22 13:55:46 +11:00
Lukasz Lenart 49ddf6130a WW-5471 Marks Sitemesh plugin as deprecated 2024-10-14 07:55:05 +02:00
Lukasz Lenart d33be1d43c [maven-release-plugin] prepare for next development iteration 2024-10-05 16:08:38 +02:00
Lukasz Lenart c812450292 [maven-release-plugin] prepare release STRUTS_6_6_1 2024-10-05 16:08:26 +02:00
Lukasz Lenart 0bd4266d2f WW-5297 Fixes checking nonce of invalidated session 2024-09-24 07:31:12 +02:00
dependabot[bot] d7626ed7d6 Bump org.codehaus.mojo:exec-maven-plugin from 3.3.0 to 3.4.1
Bumps [org.codehaus.mojo:exec-maven-plugin](https://github.com/mojohaus/exec-maven-plugin) from 3.3.0 to 3.4.1.
- [Release notes](https://github.com/mojohaus/exec-maven-plugin/releases)
- [Commits](https://github.com/mojohaus/exec-maven-plugin/compare/3.3.0...3.4.1)

---
updated-dependencies:
- dependency-name: org.codehaus.mojo:exec-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 01:55:27 +00:00