#Script gets executed in URL

11 messages · Page 1 of 1 (latest)

hearty crest
#

when i add a script to my link
What does that mean? Please post the code. It matters.

dusky ibex
#

{path: '**" ,
canActivate: [SanitizeGuard], data:
{statut: 404,
config: ConfigResolver}, component: TechnicalErrorPageComponent
}
I added this path to match any path others than the one i actually have.
But the problem is that when i use the link i provided i don t get redirected to 404.
Why is that ?

hearty crest
#

Post the code of your template. The one containing this link.

dusky ibex
#

The link isn t generated within the app.
Its to prevent script execution

hearty crest
#

If the link isn't in your template, then it doesn't use the routerLink directive, so your issue has absolutely nothing to do with Angular. How does that link end up in your Angular HTML page? That's what matters. Does it even end up in your template? Or is it in some external HTML page?

dusky ibex
#

I m doing this just so i can correctly prevent script execution from the url.

#

Normally the link should be matched with the ** and redurect to 404 ?

hearty crest
#

You're doing what? Please describe what the situation is. All we know is that you have a link somewhere. Where? what's the code of the link? How is it generated. Is it inside an Angular HTML template? Is it in some external application?

dusky ibex
#

Ok i will start from the top.
So i have a link that redirects me to a component and it is working, when i add something to the url so since it doesn t match any known path it redirects me to 404.
But adding this to the link:
+</script>"><script>alert(6)<%2Fscript>
It somehows doesn t redirect to 404 as it s supposed to do.
I am a beginner so please just ask me if there are any needed infos i should add.

hearty crest
#

I give up. Please read #how-to-get-help

dusky ibex
#

Ok will read and come back with a better question.