Files
zhengwr 98ce37c11b 报表保真层:CVE 依赖替换 + 报表只读数据源(残留1凭据/CVE 收口)
CVE(引擎 jar 不可改,但依赖可替换;已核实引擎 API 面):
- commons-collections 3.0 → 3.2.2:关 InvokerTransformer 反序列化 gadget(CVE-2015-7501)。
  引擎源码不直接引用,3.2.x 向后兼容,3.2.2 本地仓已有。
- log4j 1.2.8 → reload4j 1.2.25:drop-in,关 SocketServer/JMSAppender 等 RCE CVE。
  引擎仅用 org.apache.log4j.Logger / PropertyConfigurator,reload4j 同包同 API。
- 依赖树实证:仅 reload4j-1.2.25 + commons-collections-3.2.2 在 classpath,旧 log4j-eip3/
  commons-collections-eip3 已不再被解析(无传递回流)。

残留1(凭据外泄)收口(实测当前模板 0 处泄露,纵深防御):
- JatoolsConfig 报表连接改读 eip4.report.db.url/username/password,未配置回落 spring.datasource.*
  (向后兼容,默认零行为变化)。供配置独立的只读最小权账号 → 收口 SQLi/凭据外泄爆炸半径。
- docs/security/report-readonly-db-account.sql:只读账号 GRANT 脚本(default_transaction_read_only
  + statement_timeout + 仅 SELECT)。
- docs/security/credential-leak-scan.sql:巡检 type=200 模板把 property("DB...") 用在 <Connection>
  之外的可疑项(本库扫描 0 命中)。

验证:73单测全绿;依赖树+runtime classpath 实证替换生效;live(新 jar 8097)HTML/PDF 渲染=200、
无 ClassNotFound/log4j 错误;报表数据源 override(eip4.report.db.username)与 fallback 两条腿均实证。
注:bsh(jatools fork 不可换)/itext(只生成不解析 PDF,XXE 不可达)/xerces 2.6.2(XXE 已被前置
DOCTYPE 拒绝兜住)三项记录在案,不替换。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 08:27:47 +08:00

114 lines
6.7 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.eip4</groupId>
<artifactId>eip4-platform</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>
<artifactId>platform-report</artifactId>
<name>platform-report</name>
<description>EIP3 JOR (jatools) 报表引擎重宿主:用预编译成品 jar headless 渲染 JOR 套打模板为 HTML/PDF/XLS</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>21</maven.compiler.release>
</properties>
<!-- 预编译报表引擎 jar 装入项目内本地仓(local-repo/,随码提交)。
坐标 com.dsasp.thirdparty:*:eip3,由 install-libs.sh 用 mvn install:install-file 生成。
不用 system scope —— system scope 不会被 spring-boot-maven-plugin 打进 fat jar。 -->
<repositories>
<repository>
<id>eip3-local</id>
<url>file://${project.basedir}/local-repo</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<!-- ===== JOR(jatools) 报表引擎预编译成品 ===== -->
<!-- 引擎本体 -->
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>jatools</artifactId><version>eip3</version></dependency>
<!-- jatools 改造版 BeanShell(公式求值核心,含 8 个自定义类):必须用这份 fork,非 stock bsh -->
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>bsh</artifactId><version>eip3</version></dependency>
<!-- PDF 导出 -->
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>itext</artifactId><version>eip3</version></dependency>
<!-- XLS 导出 -->
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>jxl</artifactId><version>eip3</version></dependency>
<!-- 报表 SQL 解析 -->
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>jsqlparser</artifactId><version>eip3</version></dependency>
<!-- 图表(B 类报表,jfreechart + jcommon + jatools chart 封装) -->
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>jfreechart</artifactId><version>eip3</version></dependency>
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>jcommon</artifactId><version>eip3</version></dependency>
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>jchart</artifactId><version>eip3</version></dependency>
<!-- 条码 / 二维码 -->
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>barcode4j</artifactId><version>eip3</version></dependency>
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>zxing</artifactId><version>eip3</version></dependency>
<!-- 引擎运行期依赖的旧版 commons / log4j1 / jaxen / xerces。给独立坐标避免与平台托管版本误判去重。 -->
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>commons-beanutils</artifactId><version>eip3</version></dependency>
<!-- 安全升级:commons-collections 3.0 → 3.2.2,关掉 InvokerTransformer 反序列化 gadget(CVE-2015-7501)。
引擎源码不直接引用 commons-collections,3.2.x API 向后兼容,且 3.2.2 已在本地仓。 -->
<dependency><groupId>commons-collections</groupId><artifactId>commons-collections</artifactId><version>3.2.2</version></dependency>
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>commons-httpclient</artifactId><version>eip3</version></dependency>
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>commons-lang</artifactId><version>eip3</version></dependency>
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>commons-logging</artifactId><version>eip3</version></dependency>
<!-- 安全升级:log4j 1.2.8 → reload4j 1.2.25(drop-in,关 SocketServer/JMSAppender 等 RCE CVE)。
引擎仅用 org.apache.log4j.Logger / PropertyConfigurator,reload4j 同包同 API 完全兼容。 -->
<dependency><groupId>ch.qos.reload4j</groupId><artifactId>reload4j</artifactId><version>1.2.25</version></dependency>
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>jaxen</artifactId><version>eip3</version></dependency>
<dependency><groupId>com.dsasp.thirdparty</groupId><artifactId>xerces</artifactId><version>eip3</version></dependency>
<!-- ===== Spring(控制器 / 注入 DataSource 配置) ===== -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- JdbcTemplate:按 templateId 从 view_template(type=200) 取 JOR 模板。
DataSource 由运行宿主 platform-app 提供(spring.datasource.*)。 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<!-- 数据库驱动:模板 <Connection> 按驱动类名加载 org.postgresql.Driver,需在 classpath -->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<!-- 安全收口:可信当前用户身份(UserSession/LoggedInUser)、profile 守卫(SecurityProfiles)、
报表对象级授权所需。platform-auth 传递依赖 platform-legacy-core,显式声明对齐其它模块惯例。 -->
<dependency><groupId>com.eip4</groupId><artifactId>platform-legacy-core</artifactId></dependency>
<dependency><groupId>com.eip4</groupId><artifactId>platform-auth</artifactId></dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>21</release>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>