OWASP / OWASP/owasp-java-encoder

Fix JPMS dependency reads in the JSP, Jakarta, and ESAPI adapters

未关闭
#92 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug
主要语言
Java
星标
541
派生
122
平均合并
9 小时 9 分钟
30 天内合并 PR
1

描述

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.ForHtmlTag from the JSP module fails with IllegalAccessError: owasp.encoder.jsp does not read javax.servlet.jsp.api.
  • The equivalent Jakarta consumer fails because owasp.encoder.jakarta does not read jakarta.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-reads or --add-opens workarounds.
  • 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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 jsp/src/main/java9/module-info.java、jakarta/src/main/java9/module-info.java 和 esapi/src/main/java9/module-info.java 中的三个 Java 9 描述符开始,然后复现 issue 中描述的 JDK 17 consumer 失败。验证受支持的依赖安排和模块名称,为两个 JSP 变体及 ESAPI 添加隔离的 Named-Module consumer,并确认不使用广泛的 read 或 open workaround 的正向 module-path 测试,同时保留 classpath 和已发布元数据的行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
build-system, testing-qa
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。