Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jquery]

jQuery is a JavaScript library used for DOM manipulation.

0
votes
0answers
22 views

Is this code vulnerable to DOM based XSS? jquery wrap()

Data is read from window.location and passed to the wrap() function of function of jQuery via the following statement: t.Location.wrap(window.location) The version of jQuery in use is the 1.12.1 - ...
3
votes
3answers
97 views

Are jQuery vulnerabilities exposed by the file being served from the server of by usage of the vulnerable code?

I've recently been asked to update a legacy web application, installed on numerous client servers, to use the current version of jQuery 3.3.1, rather than 1.10.2 which has a number of vulnerabilities. ...
4
votes
0answers
94 views

XSS with escaped equal sign inside jQuery selector

Web-site uses jQuery 1.8.3 which has known XSS vulnerability in selector. (https://snyk.io/vuln/npm:jquery:20120206). It passes filtered and urldecoded document.location.hash (val2 below) value ...
0
votes
1answer
86 views

Is this code vulnerable to dom based XSS? [duplicate]

Is this code vulnerable to DOM based XSS? The application is using jQuery 3.3.1 and i noticed that Data is read from window.location.hash and passed to $() via the following statements: var hash = ...
0
votes
1answer
287 views

What would be the impact of a CVE-2015-9251 vulnerability?

I've seen that in jQuery versions older than jQuery 3 there is the CVE-2015-9251 vulnerability which can result in cross-site scripting. Is this a limited vulnerability? What could be its possible ...
2
votes
2answers
208 views

Are there XSS vulnerabilities while image preview before uploading it?

I wrote a JQuery tool to preview images before uploads. User A clicks the explore button to select an image selects it a change-event displays the image If user A selects a prepared SVG image as "...
7
votes
4answers
820 views

Exploiting XSS in jQuery without equal character?

This is some vulnerable JavaScript code: $(document).ready(function(){ var payload = unescape(document.location.hash.substr(1)); $(payload); document.body.innerText = "The payload is: " + ...
0
votes
1answer
480 views

jQuery $.get HTML code and XSS

JS code var id = $(this).data("id"); $.get("/api.php",{id:encodeURIComponent(id)}).done(function(data){ $('<div>'+data+'</div>').appendTo('.parent'); }); api.php: echo json_encode('&...
2
votes
2answers
313 views

CSRF testing of an api endpoint using GET requests

I have an api endpoint that returns a new api token in JSON to the user if they're logged in to my website with only their session cookies being used to authenticate. I'm trying to write a piece of ...
0
votes
0answers
42 views

Is DOM XSS not exploitable in the JQuery selector if it starts with #? [duplicate]

I'm using JQuery 1.7.1. When window.location.hash is passed to $() with an attack like <img src=0 onerror=alert(0)>, nothing happens, but if you strip away the #, the XSS will trigger. Is there ...
4
votes
3answers
405 views

How to audit JavaScript written by someone else before including it on my site?

I want to include a feature to add a sort function on an HTML table on my site, using the tablesorter library. I would be using this on a part of the site that requires a login to access data. But I ...
7
votes
3answers
3k views

Is XSS possible with jQuery(location.hash)?

Is it possible to exploit XSS in the following code? jQuery(window.location.hash) It seems to me that window.location.hash always starts with a hash #, and modern jQuery always interpretes this as ...
3
votes
1answer
5k views

Is there a base version of jQuery which has no XSS vulnerability?

I am working on an enterprise project and we have a upcoming new release. The security team runs a security scan, in that vulnerability report there is one point that I am struggling with. The project ...
26
votes
1answer
4k views

What is meant by “Vulnerable with: css class selector” for JQuery?

I'm mostly a beginner in cybersecurity. I came across this the other day about how JQuery 1.3.2 is vulnerable to CSS Selectors and Location Hash (source). I understand how XSS works and I know what ...
0
votes
2answers
149 views

Adding Escaped HTML to DOM

I am learning about XSS and am in the process of trying to understand why escaped HTML added to the DOM is triggering XSS vulnerability. The application will draw a modal overlay for a form (...
0
votes
0answers
490 views

detecting jquery versions with automated tools

I performed security testing of a web application by using some automated tools. Almost all tools detect only two jquery versions used in the web application. But by reviewing the code I saw that it ...
0
votes
0answers
74 views

WIll defining js variable as global cause any security issue?

I have defined global base_url in header <script> base_url = 'www.domain.com'; </script> and during ajax or other js request i am using base_url variable to fetch data from pointed url ...
0
votes
2answers
1k views

Is there a possability to inject XSS into the jQuery attr function?

I was wondering if this function would be vulnerable to XSS. var url = "google.com"; if (url.indexOf("http") != 0) { url = "http://" + url; } $("<a/>").attr("href", url); The 'url' is ...
-4
votes
1answer
5k views

Get MAC address of client using PHP, Angular js, jQuery/JavaScript [closed]

ipAddress=$_SERVER['REMOTE_ADDR']; $macAddr=false; #run the external command, break output into lines $arp=`arp -a $ipAddress`; $lines=explode("\n", $arp); #look for the output line describing our ...
2
votes
1answer
6k views

jquery.js Dynamic Code Evaluation: Code Injection on setTimeout() line

I am working on fixing a potential security issue. I ran my HP fortify SCA and I got a critical priority report on my jquery.js file. Category : Dynamic Code Evaluation: Code Injection (3 Issues). ...
4
votes
1answer
71 views

How to handle 3rd party vulnerable code?

We have recently done a static analysis of our application/s, and there are few critical findings for a 3rd party code i.e. jquery and swagger UI. What are security best practices in this case to ...
8
votes
3answers
712 views

Is Content Security Policy only enforced during initial rendering?

Is CSP enforced only during initial rendering, meaning there is no continuous coverage after your document loads? Here is an example of what I'm talking about: Let's say your page, example.com, has ...
2
votes
3answers
1k views

What is more secure practice? Hosting from CDN or Main website

There has been a long Debate on CSP modelling, I have a Web application and I use JQuery in it, For that i use JQuery main site http://code.jquery.com/jquery-x.yy.z.min.js to Host it on my Site to ...
1
vote
2answers
1k views

Is jQuery 2.1.1 vulnerable to OS command injection?

Barracuda has found multiple instances of OS Command Injection vulnerabilities in a static website. In each instance, the vulnerable URL was the jQuery plugin itself (version 2.1.1). Barracuda rates ...
1
vote
1answer
1k views

DOM based XSS: jQuery(“#HiddenReferral”).val(jQuery(location).attr('href'));

DOM based XSS has been reported by Burp Suite and showed this query as vulnerable: The application may be vulnerable to DOM-based cross-site scripting. Data is read from location and passed to ...
5
votes
2answers
983 views

Is this codes usage of document.location.toString() a DOM based XSS vulnerability?

I have come across the following JS code in multiple web applications. I think the reason for the popularity of this code snippet is this accepted answer on SO. Developers seem to be using this code a ...
0
votes
2answers
642 views

Is it secure to get auth TOKEN from server with javascript?

Is it secure to manipulate with auth token inside client side javascript over https ? I want to pass that token to websocket after login. $.getJSON( $SCRIPT_ROOT + '/jscript_get_auth_token', {}, ...
3
votes
1answer
13k views

exploiting XSS in jQuery selector

My static code analyser flags this piece of Javascript on my client's web site as a potential DOM based XSS: var x = $('#' + window.location.hash.substr(1)) x.addClass('highlighted').find('div').show(...