Properties like innerHTML and outerHTML should not be modified directly unless such modifications are clearly reviewed. Modifying innerHTML or outerHTML using user inputs that has not been validated can lead to XSS injection.
if(typeof(SERVER_DOMAIN)==='undefined'){window.location.replace("/unconfigured.html");}constRECEIVE_URL=SERVER_DOMAIN+"/challenge_scoreboard.html"+"?origin="+get_domain();varwindow_ref=null;document.getElementById("username").focus();functionstore_username(){varusername;varusername_obj;username_obj=document.getElementById("username");username=username_obj.valuevarwelcome;welcome=document.getElementById("welcome");welcome.innerHTML="Welcome "+html_encode(username);varset_username;set_username=document.getElementById("set_username");set_username.style.display="none";vargame;game=document.getElementById("game");game.style.display="inline";start_game();// have to do time out so the window can open
setTimeout(function(){send_username(username);},1000);returnfalse;}
Seamless integrations. Try Datadog Code Analysis
Datadog Code Analysis
Try this rule and analyze your code with Datadog Code Analysis
How to use this rule
1
2
rulesets:- javascript-browser-security # Rules to enforce JavaScript browser security.
Create a static-analysis.datadog.yml with the content above at the root of your repository
Use our free IDE Plugins or add Code Analysis scans to your CI pipelines