Is my site vulnerable to a XSS attack if it has no back-end code?

179 views Asked by At

I have a website where I want people to be able to input a number into an input box (tag iteration of sel) and it is taken and multiplied with a preset value stored in a tag with the class "value" whose class iteration is also sel.

Vague layout of what I have:

function multiply() {
  if(!Number.isInteger(document.getElementsByTagName('input')[sel].value)) sel = undefined;
  else {
    document.getElementById('value').textContent =
      parseInt(document.getElementsByClassName('value')[sel].value) * 
      parseInt(document.getElementsByTagName('input')[sel].value);
  }
}

I have no back-end code and everything is handled through JavaScript. Would this handling of inputs cause any issues/vulnerabilities?

I've tried to find other resources on this issue, but nothing has given me a straight answer on the main question of if there are any server or user vulnerabilities when you don't use a database and handle everything with JavaScript.

0

There are 0 answers