Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ways to insert javascript into URL?

Tags:

security

url

Duplicate of:

What common web exploits should I know about?

This is a security question.

What should I look for in URL that prevents hacking?

Is there a way to execute javascript by passing it inside a URL?

As you can see I'm pretty new to this concept.

Any good posts on this stuff?

like image 851
dev.e.loper Avatar asked Apr 01 '09 13:04

dev.e.loper


People also ask

Can I add JavaScript to a URL?

You can include JavaScript in your HTML in two ways: Writing the code in your HTML. Including it as a link to an external file.

How JavaScript is used in URL?

In JavaScript, the URL interface is used to parse, construct, normalize, and encode URLs. It provides static methods and properties to read and modify different components of the URL.

How do I add a variable to a URL?

To add a URL variable to each link, go to the Advanced tab of the link editor. In the URL Variables field, you will enter a variable and value pair like so: variable=value. For example, let's say we are creating links for each store and manager.

How add JS to HTML?

You can add JavaScript code in an HTML document by employing the dedicated HTML tag <script> that wraps around JavaScript code. The <script> tag can be placed in the <head> section of your HTML or in the <body> section, depending on when you want the JavaScript to load.


1 Answers

JavaScript injection is not at attack on your web application. JavaScript injection simply adds JavaScript code for the browser to execute. The only way JavaScript could harm your web application is if you have a blog posting or some other area in which user input is stored. This could be a problem because an attacker could inject their code and leave it there for other users to execute. This attack is known as Cross-Site Scripting. The worst scenario would be Cross-Site Forgery, which allows attackers to inject a statement that will steal a user's cookie and therefore give the attacker their session ID.

like image 145
spassen Avatar answered Sep 18 '22 05:09

spassen