sreeramadasugiri (Community Member) asked a question.

How to resolve External Control of File Name or Path (CWE ID
73), FTPClient class object.listFiles(path)

Hi Team,

My code is,

FTPClient ftpClient = new FTPClient();

FTPFileInfo ftp = new FTPFileInfo();

--------------------------------

-----------------------------------

FTPFile[] files = ftpClient.listFiles(ftp.getFilePath());

if(files!=null)

{

for (FTPFile file : files) {

if (file.isFile()) {

--------------------

}

}

}.

 

I am getting vulnerabilities in line ftpClient.listFiles(ftp.getFilePath());, i searched multiple articles, but still i am not getting as i expected answer. Can you help me to resolve my issue (CWE ID 73) flaw issue.


Topics (2)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.