How to Check a URL for High-Risk or Vulnerable Paths in JavaScript

Cloudmersive
1 min readMay 5, 2021

Did you know that the security of your information could be vulnerable to remote access by an attacker if you have a URL or relative path that’s a server administration path? These paths are high-risk because a user with malicious intent could use educated guesswork to manipulate the root path to access private directories. If you’re not sure whether your URLs are offering this dangerous opening, you can use the following API in JavaScript to automatically check if an input URL or path is a server administration path.

Our first step is to install the jQuery library:

bower install jquery

After the installation is complete, we are ready to call the function:

var settings = {
"url": "https://api.cloudmersive.com/validate/domain/url/is-admin-path",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json",
"Apikey": "YOUR-API-KEY-HERE"
},
"data": JSON.stringify("<string>"),
};
$.ajax(settings).done(function (response) {
console.log(response);
});

And just like that, the process is complete. To retrieve your API key, visit the Cloudmersive website and register for a free account; this will give you access to 800 monthly calls across our entire library of APIs.

--

--

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.