Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?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">
<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>

<groupId>sec</groupId>
Expand Down Expand Up @@ -207,7 +205,7 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.10-FINAL</version>
<version>4.1.1</version>
</dependency>

<!-- vuln maven jar. Solve xlsx.-->
Expand Down Expand Up @@ -428,4 +426,4 @@
</build>


</project>
</project>
9 changes: 7 additions & 2 deletions src/main/java/org/joychou/controller/othervulns/ooxmlXXE.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package org.joychou.controller.othervulns;

import org.apache.poi.ss.usermodel.CellType;

import org.apache.poi.xssf.usermodel.XSSFCell;

import org.apache.poi.xssf.usermodel.XSSFRow;

import org.apache.poi.xssf.usermodel.XSSFSheet;

import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -60,9 +65,9 @@ public String ooxml_xxe(MultipartFile file) throws IOException {
while (cells.hasNext()) {
cell = (XSSFCell) cells.next();

if (cell.getCellType() == XSSFCell.CELL_TYPE_STRING) {
if (cell.getCellTypeEnum() == CellType.STRING) {
sbResult.append(cell.getStringCellValue()).append(" ");
} else if (cell.getCellType() == XSSFCell.CELL_TYPE_NUMERIC) {
} else if (cell.getCellTypeEnum() == CellType.NUMERIC) {
sbResult.append(cell.getNumericCellValue()).append(" ");
} else {
logger.info("errors");
Expand Down