Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I ' m struggleing with a manual review of this program. I need to identify 7 - 1 0 vulnerabilities and include a description that
Im struggleing with a manual review of this program. I need to identify vulnerabilities and include a description that identifies where the vulnerabilities are found and providing specific class files where applicable.
CRUD.java
package com.twkrestservice;
public class CRUD
private final String content;
private final String content;
public CRUDString content
this.content content;
this.content content;
public CRUDString content String content
this.content content;
this.content content;
public String getContent
return content;
public String getContent
return content;
CRUDController.java
package com.twkrestservice;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class CRUDController
@RequestMappingread
public CRUD CRUD@RequestParamvalue"businessname" String name
DocData doc new DocData;
return new CRUDdoctoString;
Customer.java
package com.twkrestservice;
public class customer
private int accountnumber;
int accountbalance;
public int showInfo
code to show customer information
return this.accountnumber;
public void depositint a
accountbalance accountbalance a;
DocData.java
package com.twkrestservice;
import java.sql;
public class DocData
private String id;
public DocData
public String getId
return id;
public void readdocumentString key, String value
implement read method
ClassforNamecommysqljdbcDriver";
try
Connection conDriverManager.getConnection
jdbc:mysql:localhost:test"root","root";
catch SQLException e
TODO Autogenerated catch block
eprintStackTrace;
here test is database name, root is username and password
Greeting.java
package com.twkrestservice;
public class Greeting
private final long id;
private final String content;
public Greetinglong id String content
this.id id;
this.content content;
public long getId
return id;
public String getContent
return content;
GreetingController.java
package com.twkrestservice;
import java.util.concurrent.atomic.AtomicLong;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class GreetingController
private static final String template "Hello, s;
private final AtomicLong counter new AtomicLong;
@GetMappinggreeting
public Greeting greeting@RequestParamvalue "name", defaultValue "World" String name
return new GreetingcounterincrementAndGet String.formattemplate name;
myDataTime.java
package com.twkrestservice;
public class myDateTime
int mySecond;
int myMinute;
int myHour;
int retrieveDateTime
implement accessor method
return new int;
void setMyDateTimeint seconds, int minutes, int hour
implement accessor method
RestServiceApplication.java
package com.twkrestservice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RestServiceApplication
public static void mainString args
SpringApplication.runRestServiceApplicationclass, args;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started