OWASP / OWASP/owasp-java-encoder
Fix JPMS dependency reads in the JSP, Jakarta, and ESAPI adapters
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 541
- Forks
- 122
- Avg merge
- 9h 9m
- Merged PRs (30d)
- 1
Description
Follow-up to #90 (reviewed at 31588e1). This tracks work intentionally kept separate from the modernization PR.
Problem and evidence
The explicit descriptors in jsp/src/main/java9/module-info.java, jakarta/src/main/java9/module-info.java, and esapi/src/main/java9/module-info.java require only owasp.encoder. They do not declare reads for their external API dependencies.
Consumer execution on JDK 17 reproduced:
- Loading
org.owasp.encoder.tag.ForHtmlTagfrom the JSP module fails withIllegalAccessError:owasp.encoder.jspdoes not readjavax.servlet.jsp.api. - The equivalent Jakarta consumer fails because
owasp.encoder.jakartadoes not readjakarta.servlet.jsp. - Calling
ESAPIEncoder.getInstance()with the adapter on the module path and ESAPI on the classpath fails because the adapter does not read the unnamed module.
The same failures occur with published 1.4.0. These are pre-existing issues, not regressions introduced by #90. Merely running jar --describe-module does not exercise these linkage failures.
Acceptance criteria
- Determine and document supported module-path dependency arrangements and API versions for each adapter.
- Correct descriptors, including transitive readability where required by exposed public APIs; use real dependency module names verified against the supported artifacts.
- Add isolated named-module consumers that instantiate/use JSP and Jakarta tags and call the ESAPI adapter. Test the two JSP variants separately because they share a package name.
- Positive tests work without broad
--add-readsor--add-opensworkarounds. - Retain classpath/container behavior, provided dependency scopes, existing public APIs, Java 8 base bytecode, published automatic-module names, explicit module identities, and OSGi metadata.
Related historical module support discussion: #66.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the three Java 9 descriptors in jsp/src/main/java9/module-info.java, jakarta/src/main/java9/module-info.java, and esapi/src/main/java9/module-info.java, then reproduce the JDK 17 consumer failures described in the issue. Verify supported dependency arrangements and module names, add isolated named-module consumers for both JSP variants and ESAPI, and confirm positive module-path tests without broad read or open workarounds while preserving classpath and published metadata behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100