Stack Exchange Network

Stack Exchange network consists of 175 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 [javascript]

The common name for the language used primarily for scripting in web browsers. It is not related to the Java language. Standardized as ECMAScript, its dialects/implementations include JavaScript and JScript.

25
votes
3answers
6k views

What is formjacking?

I just heard a very confused news broadcast about Symantec warning the world about the dangers of formjacking. The newsreader said it involved “hacking the form, not the website” whatever that means. ...
0
votes
0answers
25 views

Malware Attack Error On Wordpress Website [on hold]

How to fix malware attack error from Sucuri on WordPress website? I am getting this malware attack error on my WordPress website: Malware entry: rogueads.unwanted_ads Description: Varios malicious ...
1
vote
0answers
43 views

How to start with javascript engine exploitation [on hold]

I am beginner in exploit development. My experience is developing buffer overflow exploits and shellcoding. Now I want to begin with javascript engine exploitation. 1.What are five papers, books, ...
2
votes
1answer
51 views

What's stopping attackers from using our API keys to spam our logging services?

We're logging user events using Javascript and a third-party logging service. The API key is hardcoded in JS. The logging service restricts the API key to our domain. I'm assuming it looks at the ...
-1
votes
0answers
10 views

SiteCatalyst code consider a security risk or what ? and old version? [closed]

I found a javascript file containing SiteCatalyst code and some configuration data like /* Form Analysis Config */ /* Visitor Migration */ /* URL Plugin Config (prop36) + Domain Period Logic */ ...
1
vote
1answer
34 views

Does CSP block javascript in <a href> tags?

I recently discovered that its possible to run javascript from an <a> tag like this <a href="javascript:alert('test')"> and this gets run on the current page when clicked. It also seems ...
0
votes
0answers
73 views

Is this script vulnerable to xss? If yes, how can i get an alert box?

I think this code may be vulnerable to dom based xss but i wasn't able to get an alert box. I am able to control the userTitle field, i tried using </script> but it get changed to u003c/...
0
votes
0answers
21 views

JS window.confirm cross domain security?

I have wrote an assignment for a course I am studying regarding social plugins like what you get with Facebook/Twitter, etc. With these platforms the user is directed to a seperate tab/window to ...
0
votes
2answers
107 views

Prevent javascript cross-origin redirect by window.location.href

Following this question, is there a way to prevent this code from redirecting users to domains not whitelisted? const form = document.getElementsByTagName('form')[0]; form.addEventListener('submit', ...
0
votes
1answer
57 views

Do I correctly understand how CORS proxy works?

There are a lot of CORS proxy servers like this one: https://cors-anywhere.herokuapp.com/ This allows us to send requests from different origins. For example I can send request from my client's ...
0
votes
0answers
29 views

Best way to take javascript code as input from customer and use them on site

I am working on a SAAS app with multiple customers, on their admin panel they have option to add code to add in header. This is a textarea which can take javascript code as input and then this code ...
-1
votes
2answers
90 views

Can the following hash technique be reversed? If so, would it be difficult?

I was wondering if the following hashing technique can easily be reversed? If someone got hold of the hashed value, can he/she reverse it? Partiuclarly I'm talking about the following code: ...
0
votes
1answer
52 views

Password managers, how do they get the credentials when you press enter?

I was wondering how password managers (most of the at least) automatically prompt to save my username and password credentials after inserting them into any site. I mean I am not first putting them ...
2
votes
3answers
101 views

Returning POST JSON data securely?

I have a webpage (HTTPS encrypted and authorized only via domain credentials) that displays grid information. This grid information is received via a POST request to my server which will send back ...
0
votes
1answer
35 views

How are these transaction fingerprints colored?

For those unfamiliar, blockchains have two main types of data structures propagated in their networks: blocks and transactions. Each block and transaction has a hash, just like key fingerprints. The ...
1
vote
1answer
75 views

How can CSRF POST happen?

I realise this is a newbie question but when it comes to this im clearly that. On a browser, assuming one received a cookie from site A. Then a different site B makes a call to site A through it's ...
1
vote
0answers
49 views

How can user send malware code via input=file

After the file is uploaded via input=file it is converted to b64 standard. But what is the exact path the file is going through and where in javascript code we can catch that uploaded file. And if I ...
0
votes
1answer
42 views

How do JavaScript (and mobile) APIs keep user data clean?

Let's say we're running Google Analytics, and we're tracking user specific data (or displaying contents based on that data, such as most recently viewed pages) -- we add a pixel, and then we pass the ...
3
votes
3answers
100 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. ...
1
vote
2answers
71 views

Why do browsers disallow accessing files from local file system even if the HTML document is also on the local file system?

Many browsers do not allow you to access files on the local filesystem with JavaScript (even if the HTML document is also on the local filesystem). (source) Yes I know that the solution is to "...
-1
votes
2answers
125 views

Is it safe to eval JSON?

I know JSON is supposed to be a notation that can otherwise function as direct-code to evaluate Javascript? But is that so? There is a function I know about and use when I must, JSON.parse. It's the ...
1
vote
2answers
53 views

How to make Location header invalid, on 3xx redirect resulting in showing HTML

I came accross vulnerability where i can breakout in html body on 3xx redirect, my problem is that Location header is executed first means that html body is ignored. <a href="https://example.com/"[...
0
votes
1answer
193 views

XSS code not fetching back script

I am doing a XSS challenge on HTB and have run into an issue. I have the unvalidated field that is vulnerable to XSS and so far I have got the below line to successfully call back to a python server ...
1
vote
0answers
79 views

Android WebView JavaScript Enabled

I recently found an Android application, which uses a WebView with enabled JavaScript. In this webview I am able to browse from their provided FAQ page to twitter, and from twitter basically ...
3
votes
1answer
57 views

What data related to a specific web page can be obtained outside the browser?

The browser has several built-in storages, such as local storage or indexedDB. Does it make sense to store sensitive data in them if there is a risk that some malware can access the browser's data ...
1
vote
1answer
70 views

Is this code vulnerable to DOM based XSS jquery animate? [duplicate]

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

Prevent javascript cross-origin write

Let's assume an attacker manages to inject this script in a login page: const form = document.getElementsByTagName('form')[0]; form.addEventListener('submit', stealCredentials); function ...
1
vote
2answers
103 views

Is taking CC info in plain HTML elements, but using a library like Stripe to tokenize PCI compliant?

I am building a site which will accept payments. I will be processing payments with either Stripe or Square. Stripe now has Stripe Elements, and Square has Square Payment Form. I have tried Square ...
0
votes
1answer
111 views

How secure is WebPack? [closed]

If NPM packages are so vulnerable as described in this article, is it acceptable to use WebPack for web-applications, in which security is a priority? Edit: when using WebPack you should use NPM-...
0
votes
4answers
185 views

XSS payload shorter than 20 character

For an university project I have to perform an analysis on a web application to find out XSS vulnerabilities. After this I have to report and create automatic test to prove vulnerabilities that I have ...
2
votes
2answers
153 views

Why is it important to never use `eval` in conjunction with AJAX?

From OWASP AJAX Security Cheat Sheet: Eval is evil, never use it. Needing to use eval usually indicates a problem in your design. I understand that evaling untrusted JS code can lead to a whole ...
71
votes
10answers
17k views

Why is JavaScript “safe” to run in the browser?

JavaScript has certain limitations such as preventing reading and writing to disk and not allowing access to other browser windows or domains. But is that all that's needed to prevent malicious code ...
1
vote
2answers
135 views

What to do about vulnerability in a SaaS product I buy?

I work for a university, where I am part of the team responsible for integrating a SaaS Learning Management System (eg: Moodle, Canvas) with the rest of the university's systems. Two months ago, I ...
3
votes
1answer
180 views

How do I make safe login-emails? (GET/POST) [duplicate]

Vision I envision a login/signup-system, where the user enters his/her email, and receives an email with a link to sign in. The user clicks the link, and is automatically signed in (confirming the ...
0
votes
2answers
97 views

XSS alert not working with concatenated string

I've noticed that the following Stored XSS does not execute, whereas in the JS console it works: <img src=0 onerror=alert(document.domain+": "+Date.now())> This doesn't prompt an alert box. ...
0
votes
1answer
79 views

Reflected XSS in multiline script block

I am trying to exploit a reflected cross site scripting in a GET request where the reflection is in the first multi line script block. It seems I can use every character but <, > and " and the ...
1
vote
1answer
135 views

Send GET request from a PDF file

I'm currently working on a security Proof Of Concept where I need to show the danger of opening an unknown PDF file. Internet says that many malwares use Javascript in PDF document (AcroJS) to ...
3
votes
2answers
58 views

Using SessionStorage for Some User Info

I have an application that currently keeps a few properties from a user's profile in session storage for the app to use when necessary. We don't keep sensitive data like username or password or ssn in ...
1
vote
0answers
80 views

Understanding XSS

So, I am trying to understand how XSS works and I gathered some information online and crafted the code. Following is the snippet. When I enter some value in the text field and submit, the script ...
3
votes
1answer
43 views

When I upload a file on browser, will the server know my file path or disk info?

I believe server can know my file name. What other info will browser tell the server? File path? Disk info?
4
votes
2answers
135 views

How to safely allow scripts but preventing XSS?

We are trying to find the best way to allow JavaScript in a web application while being safe against XSS. Site admins have the privilege to insert JavaScript to control the site templates, and ...
3
votes
2answers
507 views

Use XSS vulnerability in iframe to compromise parent?

I have a site, let's call it parent.com, that embeds a third party plugin from child.com in an iframe. I have found a XSS vulnerability on child.com. The embedded page from child.com contains a form ...
3
votes
2answers
468 views

Malicious PDF file upload

I have a web server for my customers to upload their PDF files. I have also an IDS/IPS with Anti-Malware license that is between the user and the web server and blocks malicious PDF files from ...
2
votes
1answer
46 views

DAST Output in Burp and Understanding It

I have recently upgraded to the newest version of Burp which includes the new DAST tools. I am receiving reports from the tool that it has found DOM-Based Javascript Injection, but I am having ...
0
votes
1answer
103 views

How to exploit CSRF using HTML form to save data? [duplicate]

So I found a CSRF vulnerability on a website. The website is sending GET request to get user data and there is no protection. So using HTML I can get the data from the website if the user is logged in,...
0
votes
2answers
58 views

Security risks downloading external images automatically from script

I'm a developping a program which generates images from HTML files filled with external RSS feeds data. When the RSS feed contains images, I need to check their resolution and format (for instance, if ...
2
votes
1answer
271 views

PDF and embedded JavaScript

We have completed a vulnerability and a penetration test. One feature of our application allows for documents to be uploaded, and we allow for PDF documents. Prior to a document being accepted we ...
84
votes
5answers
20k views

Can “Accept cookie” button in a website be malicious?

I don't remember when this "accept/cancel cookie" button started to be used in websites. Why do they insist on getting users to click on this button? Can it do any harm to user's PC or to collect ...
2
votes
1answer
97 views

Are unescaped backslashes dangerous in terms of XSS?

I thought the \ (backslash) character was a dangerous character that you needed to filter out/properly encode to protect against XSS attacks (OWASP says so, too), and I still do, but why? I found a ...
0
votes
1answer
234 views

How can I execute a XSS on 302 redirect and the body on the page?

Is there a way to execute XSS? on 302 redirect and the body on the page? <HTML><HEAD> <TITLE>302 Moved Temporarily</TITLE> </HEAD> <BODY> The document has moved &...