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.

2
votes
1answer
104 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
2answers
410 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
380 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
240 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
37 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
309 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 ...
6
votes
1answer
2k 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
3k 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
117 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
452 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
58 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
4k 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
5k 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
69 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
611 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
951 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
918 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 ...
4
votes
2answers
795 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
605 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
11k 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(...