Skip to content

Commit

Permalink
Insecure.inc - Update to JRE 21
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-ion committed Mar 17, 2024
1 parent 0e9b22e commit 8e85ae9
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 72 deletions.
4 changes: 2 additions & 2 deletions insecureinc/Dockerfile.insecureinc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Please use buildImage.sh script to build this image.
# This stage is compiling the code and packaging war file in target folder
FROM maven:3.8.1-openjdk-8 as build_image
FROM maven:3.9.6-eclipse-temurin-21-alpine as build_image
ADD . /insecureinc
RUN cd /insecureinc && mvn clean install

FROM tomcat:8.5-jre8
FROM tomcat:11.0-jre21
RUN rm -rf /var/lib/apt/lists/* && \
apt-get update --fix-missing &&\
apt-get -y install gcc
Expand Down
19 changes: 12 additions & 7 deletions insecureinc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>6.1.0-M2</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -27,7 +27,12 @@
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-util</artifactId>
<version>8.5.53</version>
<version>11.0.0-M18</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>11.0.0-M18</version>
</dependency>
<dependency>
<groupId>org.openjdk.nashorn</groupId>
Expand All @@ -40,10 +45,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<version>3.12.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>21</source>
<target>21</target>
<optimize>true</optimize>
<debug>true</debug>
</configuration>
Expand Down
14 changes: 7 additions & 7 deletions insecureinc/src/main/java/insecure/inc/Ch1Loggedin.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

/**
* Servlet implementation class Ch1Loggedin
Expand Down
10 changes: 5 additions & 5 deletions insecureinc/src/main/java/insecure/inc/Cwe22Servlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
package insecure.inc;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
* Servlet implementation class Cwe22Servlet
Expand Down
10 changes: 5 additions & 5 deletions insecureinc/src/main/java/insecure/inc/Cwe352Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
package insecure.inc;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
* Servlet implementation class Cwe352Profile
Expand Down
16 changes: 8 additions & 8 deletions insecureinc/src/main/java/insecure/inc/Cwe434FileUpload.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.http.Part;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.MultipartConfig;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import jakarta.servlet.http.Part;

/**
* Servlet implementation class Cwe434FileUpload
Expand Down
14 changes: 7 additions & 7 deletions insecureinc/src/main/java/insecure/inc/Cwe611FileUpload.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
package insecure.inc;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.MultipartConfig;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.Part;

/**
* Servlet implementation class Cwe611FileUpload
Expand Down
10 changes: 5 additions & 5 deletions insecureinc/src/main/java/insecure/inc/Cwe79Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
package insecure.inc;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
* Servlet implementation class Cwe79Profile
Expand Down
10 changes: 5 additions & 5 deletions insecureinc/src/main/java/insecure/inc/GetCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import java.io.IOException;
import java.security.NoSuchAlgorithmException;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

/**
* Servlet implementation class GetCode
Expand Down
10 changes: 5 additions & 5 deletions insecureinc/src/main/java/insecure/inc/SetUnlockCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

import java.io.IOException;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

/**
* Servlet implementation class GetCode
Expand Down
20 changes: 10 additions & 10 deletions insecureinc/src/main/java/insecure/inc/UnlockCodeFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
package insecure.inc;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.annotation.WebFilter;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

/**
* Servlet Filter implementation class UnlockCode
Expand Down
12 changes: 6 additions & 6 deletions insecureinc/src/main/java/serial/SubmitObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import org.apache.tomcat.util.codec.binary.Base64;

Expand Down

0 comments on commit 8e85ae9

Please sign in to comment.