Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b6f9742
Create pom.xml
kawasima May 13, 2015
212bb0f
Fixed CVE-2014-0114
kawasima May 13, 2015
1ba1203
Added circleci badges.
kawasima May 13, 2015
fdd9eb8
Added the TLD generator.
kawasima Sep 28, 2015
eda3a79
Fixed CVE-2016-1181 and CVE-2016-1182
kawasima Jun 8, 2016
3fb0bf8
Fix for CVE-2015-0899
pgbhagat Mar 28, 2017
df1aa1a
support JDK9 or higher
kawasima Aug 24, 2018
2040002
Add profile for JDK11 or higher
kawasima Jul 4, 2019
56f8f7c
Update dependency versions in pom.xml for improved compatibility and …
kawasima Feb 18, 2026
eaac9ef
Merge pull request #1 from pgbhagat/STRUTS_1_2_BRANCH - Fix for CVE-2…
kawasima Feb 18, 2026
a5741a6
Update log4j dependencies and clean up test code in TestRequestUtilsP…
kawasima Feb 18, 2026
614dc09
Refactoring the project structure
kawasima Feb 28, 2026
0993737
Add unit tests for Struts tag libraries and utility classes
kawasima Mar 1, 2026
d9daed2
Add default Struts Validator rules configuration
kawasima Mar 1, 2026
13ae9cb
Fix GHSA-xgrq-qjm7-p99v: validate page parameter in SwitchAction to p…
kawasima Mar 1, 2026
eafc6ad
Merge commit from fork
kawasima Mar 1, 2026
0c72b79
Fix GHSA-3chx-2h2f-rvq5: HTML-escape error messages in ErrorsTag to p…
kawasima Mar 1, 2026
0fbe394
Merge commit from fork
kawasima Mar 1, 2026
ab6bed4
Fix GHSA-74mq-mxf7-qchm: enforce per-text-field size limit in multipa…
kawasima Mar 1, 2026
32c288b
Merge commit from fork
kawasima Mar 1, 2026
54f16db
Merge commit from fork
kawasima Mar 1, 2026
2a2b5db
Fix GHSA-cr42-9px3-5v7x: suppress validatorResults from request param…
kawasima Mar 1, 2026
c625ba4
Merge commit from fork
kawasima Mar 1, 2026
b780a29
Fix GHSA-6gxc-rr3q-63w6: validate locale components in I18nFactorySet…
kawasima Mar 1, 2026
ce0a81d
Merge commit from fork
kawasima Mar 1, 2026
383c76c
Fix GHSA-r7xj-rhwv-rpq5: sanitize keyName in LookupDispatchAction log…
kawasima Mar 1, 2026
f6099b5
Merge commit from fork
kawasima Mar 1, 2026
dfaeccc
Refactor constructors in mock classes to use direct field assignments…
kawasima Mar 1, 2026
13434f3
Release 1.2.9-forever-2
kawasima Mar 1, 2026
3f0024b
Prepare next development iteration
kawasima Mar 1, 2026
8f9eb88
Remove deprecated suppression annotations from TestForwardAction test…
kawasima Mar 1, 2026
f26fc87
Add backward compatibility policy to CLAUDE.md
kawasima Mar 10, 2026
d5190ef
Fix GHSA-qvw9-94w8-h5rp: Add filter attribute to OptionTag for HTML e…
kawasima Mar 10, 2026
a42858a
Fix GHSA-h36r-7whm-p5hf: Disable XXE in all Digester instances
kawasima Mar 10, 2026
f8cb68a
Fix GHSA-m354-cxgf-p7fp: escape field key in JavascriptValidatorTag t…
kawasima Mar 10, 2026
26dfa63
Tighten TestJavascriptValidatorTag: fix assertion and update Javadoc
kawasima Mar 10, 2026
9811cff
Refactor TokenProcessor to use SecureRandom for token generation and …
kawasima Mar 10, 2026
7da0e1f
Improve token validation by using constant-time comparison and add re…
kawasima Mar 14, 2026
b860472
Fix XSS vulnerability by escaping values in BaseHandlerTag
kawasima Mar 14, 2026
b1dbdbe
import MessageDigest for future token processing enhancements
kawasima Mar 14, 2026
dadb5ee
Release 1.2.9-forever-3
kawasima Mar 14, 2026
a159ce2
Prepare next development iteration
kawasima Mar 14, 2026
4e5daae
Build a jakarta-classifier JAR with Eclipse Transformer
kawasima Nov 25, 2026
912a8c9
Verify the jakarta JAR against the Servlet 6.0 contract and Tomcat 10.1
kawasima Nov 25, 2026
7006f4a
Reference #3 in the integration test's DOCTYPE workaround
kawasima Nov 25, 2026
b782536
Close the remaining gaps in jakarta JAR verification
kawasima Nov 25, 2026
a4f7f7c
Check every API type name, pin the link checks, and align getParamete…
kawasima Nov 25, 2026
73e77a4
Merge pull request #9 from kawasima/feature/jakarta-classifier
kawasima Nov 25, 2026
272ddaa
Accept DOCTYPE declarations and read only registered DTDs
kawasima Nov 25, 2026
265d101
Enforce the XML parsing policy on every parser Struts uses
kawasima Nov 25, 2026
d693677
Check the limits that the parsing policy relies on, not the switches
kawasima Nov 25, 2026
b1b5ef0
Stop on every fatal error and never relax an existing parser limit
kawasima Nov 25, 2026
a361daa
Compare entity expansion limits in the number of expansions they allow
kawasima Nov 25, 2026
2943a40
Keep ValidatorPlugIn working with the Commons Validator in WEB-INF/lib
kawasima Nov 25, 2026
458b4ca
Merge pull request #11 from kawasima/feature/issue-3
kawasima Nov 25, 2026
3239cf1
Escape only what can end an attribute in tag output
kawasima Nov 25, 2026
a6397d1
Remove the README section added in #11
kawasima Nov 25, 2026
00516f1
Escape submitted values as data, labels and handlers as HTML
kawasima Nov 25, 2026
8bb72dc
Escape the option label and form names by what they hold
kawasima Nov 25, 2026
04f90c0
Merge pull request #12 from kawasima/feature/issue-4
kawasima Nov 25, 2026
85e2883
Test html:option labels from a key and from a nested bean:write
kawasima Nov 25, 2026
34b1470
Read option labels as the browser does and run bodies through doAfter…
kawasima Nov 25, 2026
cb90f5b
Merge pull request #13 from kawasima/feature/issue-5
kawasima Nov 25, 2026
a4d5ba2
Write html:errors templates as HTML and escape only their arguments
kawasima Nov 25, 2026
602051e
Record what HtmlMessageFormatter copies and test the tag around it
kawasima Nov 25, 2026
b937fad
Quote markup in the ChoiceFormat test pattern
kawasima Nov 25, 2026
d2b9d43
Describe HtmlMessageFormatter and its tests as Struts code
kawasima Nov 25, 2026
b6fa0f1
Merge pull request #14 from kawasima/feature/issue-6
kawasima Nov 25, 2026
3eaa9fa
Ship the Commons Validator 1.1.4 scripts for html:javascript
kawasima Nov 25, 2026
3da49aa
Merge pull request #15 from kawasima/feature/issue-7
kawasima Nov 25, 2026
a5466c1
Ship a servlet3 JAR whose MultipartRequestWrapper extends HttpServlet…
kawasima Nov 25, 2026
14d8490
Tell tests which JAR they test and pin the wrapper contract of each
kawasima Nov 25, 2026
f64f63c
Keep the duplicate JAR check from failing ActionServlet.init()
kawasima Nov 25, 2026
5516245
Merge pull request #16 from kawasima/feature/issue-10
kawasima Nov 25, 2026
b053ed3
Release 1.2.9-forever-4
kawasima Nov 25, 2026
205744a
Prepare next development iteration
kawasima Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 0 additions & 14 deletions .cvsignore

This file was deleted.

38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Java
*.class
*.jar
*.war
*.ear

# Eclipse
.project
.classpath
.settings

# Idea
.idea
*.iml
*.iws
*.ipr

# OS
Thumbs.db
.DS_Store

# Gradle
.gradle
!gradle-wrapper.jar

# Maven
target

# Build
out
build
bin

# Other
*.log
*.swp
*.bak
TODO.md
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
}
280 changes: 280 additions & 0 deletions CLAUDE.md

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions INSTALL

This file was deleted.

112 changes: 0 additions & 112 deletions KEYS

This file was deleted.

19 changes: 0 additions & 19 deletions LICENSE.CheckStyle

This file was deleted.

21 changes: 0 additions & 21 deletions README

This file was deleted.

102 changes: 102 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# STRUTS

![build status](https://circleci.com/gh/kawasima/struts1-forever.png?style=shield&circle-token=8f99c0e6c923ca570acda8c3640446fdacad2a47)

This struts1's fork is for maintenance to fix the vulnerabilities.

## Requirements

The classes of the default JAR are compiled for Java 1.4 (releases are built with JDK 8), and those of the servlet3 and jakarta JARs for Java 8. The dependencies that the POM declares need Java 8: Commons BeanUtils 1.11.0, Commons FileUpload 1.6.0 and Commons IO 2.19.0. Whatever versions you use, Struts needs Commons BeanUtils 1.9.2 or later, because it uses `SuppressPropertiesBeanIntrospector` to prevent the population of dangerous properties (CVE-2014-0114).

## Servlet 3.0 to 4.0 (Tomcat 7 to 9)

For the request of a multipart form, Struts passes its own `org.apache.struts.upload.MultipartRequestWrapper` to the Action. In the default JAR this class implements `HttpServletRequest` itself and is compiled against Servlet 2.2, so on a Servlet 3.0 or later container the methods added since then do not reach the container's request:

- Abstract methods, such as `getServletContext()` or `getDispatcherType()`, throw `AbstractMethodError`.
- The default methods of Servlet 4.0 (`getHttpServletMapping()`, `newPushBuilder()`, `getTrailerFields()`, `isTrailerFieldsReady()`) return the interface's default instead of the container's value.

The default JAR keeps this class as it is for applications that subclass it. Each release also ships `struts-<version>-servlet3.jar`, which contains the same classes except that `MultipartRequestWrapper` extends `javax.servlet.http.HttpServletRequestWrapper`, so the container's request answers every method of its Servlet API.

| | |
| --- | --- |
| Target API | Servlet 3.0 to 4.0 |
| API compatibility checked against | Servlet 3.0 / JSP 2.2, Servlet 3.1 / JSP 2.3, Servlet 4.0 / JSP 2.3 |
| Runtime tested on | Tomcat 9.0 (Servlet 4.0) |
| Class file version | Java 8 |

The API compatibility check verifies that every class loads and that every Servlet/JSP class, method and field it uses exists in that API version. For this JAR, Tomcat 9.0 runs a multipart request through the Action in the build.

`MultipartRequestWrapper` in this JAR differs from the one in the default JAR:

- It has no `protected request` field. Subclasses use `getRequest()` and `setRequest()`, which accepts only an `HttpServletRequest`.
- `getRealPath(path)` returns `getServletContext().getRealPath(path)`, and `isRequestedSessionIdFromUrl()` returns `isRequestedSessionIdFromURL()`, instead of calling the method of the same name on the wrapped request. Servlet 6.0 removed both methods, and the jakarta JAR uses the same class.
- Exceptions thrown by the wrapped request reach the caller, except that `setCharacterEncoding()` logs an `UnsupportedEncodingException` instead of throwing it, as the default JAR does. The default JAR logs any exception from `setCharacterEncoding()`, `getRequestURL()`, `isRequestedSessionIdFromCookie()`, `getLocalAddr()`, `getLocalName()`, `getLocalPort()` or `getRemotePort()` and returns `null`, `false` or `0`.

The servlet3 JAR replaces the default JAR. Keep only one Struts JAR in `WEB-INF/lib`, and exclude `struts:struts` without classifier if another dependency brings it in. With two Struts JARs, the class loader decides which `MultipartRequestWrapper` is used; `ActionServlet` logs a warning at startup when it finds its own class in more than one location.

```xml
<dependency>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
<version>${struts.version}</version>
<classifier>servlet3</classifier>
</dependency>
```

## Jakarta EE (Tomcat 10+)

Each release also ships `struts-<version>-jakarta.jar` for containers that use the `jakarta.servlet` namespace. It is built from the same sources as the javax JAR, so it contains the same fixes. Your own code still has to be migrated from `javax.servlet` to `jakarta.servlet`. Like the servlet3 JAR, it replaces the default JAR: keep only one Struts JAR in `WEB-INF/lib`.

| | |
| --- | --- |
| Target API | Jakarta Servlet 5.0 or later, Jakarta Server Pages 3.0 or later |
| API compatibility checked against | Servlet 5.0 / JSP 3.0, Servlet 6.0 / JSP 3.1, Servlet 6.1 / JSP 4.0 |
| Runtime tested on | Tomcat 10.1 (Servlet 6.0 / JSP 3.1) |
| Class file version | Java 8 |

For this JAR, Tomcat 10.1 runs the full request cycle in the build.

`MultipartRequestWrapper` is the class of the servlet3 JAR, converted to `jakarta.servlet`; it extends `jakarta.servlet.http.HttpServletRequestWrapper` and differs from the default JAR as described above.

The jakarta JAR bundles Commons FileUpload 1.6.0, converted to `jakarta.servlet`, under its original package names. When you switch to it:

- Remove `commons-fileupload-1.x.jar` from `WEB-INF/lib`. Two copies of the same classes on the classpath cause unpredictable class loading.
- Keep `commons-io` (2.19.0 or later). FileUpload needs it.
- With Maven, exclude `commons-fileupload` from the dependency:

```xml
<dependency>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
<version>${struts.version}</version>
<classifier>jakarta</classifier>
<exclusions>
<exclusion>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
</exclusion>
</exclusions>
</dependency>
```

## Fixed vulnerabilities

- CVE-2014-0114
- CVE-2016-1181
- CVE-2016-1182

## Introduction (Original)

This subproject contains the source code for the "Struts" application support
package, consisting of the following major components:

- Controller servlet with action mapping technology, implementing the Model-
View-Controller (MVC) design pattern for web applications commonly called
"Model 2", with a servlet as the "front component".

- Comprehensive custom tag library for building internationalized JSP pages
that have HTML forms which interact with JavaBeans that are managed
automatically by the controller servlet.

For help with installing and using Struts, see the Struts User Guide.

Loading