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 [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.

0
votes
2answers
56 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
22 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
68 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 ...
-1
votes
0answers
47 views

HTML to view content of folder through notation file:///temp or similar

I'm making an experiment to check if I can view the content of a folder by using HTML when javascript is restricted. In that case I'm not able to create variables so how can I store our results so ...
3
votes
2answers
45 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
55 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
37 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?
0
votes
0answers
23 views

Trailing garbage after Python decryption of JavaScript AES-CGM [migrated]

I have JavaScript tied to an HTMl button, which does an AES-CGM encoding and logs the useful info to the console. function strToArrayBuffer(str) { let buf = new ...
2
votes
1answer
53 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 ...
0
votes
0answers
22 views

How do I convert javascript Blob to FileList? [migrated]

How do i convert a javascript blob to a filelist so as to append it to a form input file. I've tried: var blob = new Blob(recordedBlobs, {type: 'video/mp4'}); $('input#file').prop("files", [(new ...
3
votes
2answers
143 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 ...
0
votes
0answers
23 views

WordPress javascript code injection [duplicate]

Google notified me that there are malicious links on my website: https://cobalten.com/apu.php?zoneid=2025634 https://go.oclasrv.com/apu.php?zoneid=2025634 https://wowreality.info/page.js?wm=gr It's ...
0
votes
1answer
48 views

I need help for avoiding ajavascript injection

I tried lots of solutions but no one seemed to work, I am doing an api that returns a random image in nodejs and express, While I was testing it I realized that I could input in the url bar '...
3
votes
2answers
162 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
27 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 ...
-1
votes
0answers
34 views

Detect all the web application's user-defined variables

How to detect all the web application's user-defined variables for each web page? How can I view hidden variables?
0
votes
1answer
48 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
45 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 ...
0
votes
0answers
24 views

X-Frame-Options may only be set via an HTTP header sent along with a document. It may not be set inside <meta> [migrated]

I am getting this error in VS 2010 Web Forms application developed in VB.NET. javascript:return WebForm_OnSubmit(); When I hover over it I get the error in the subject line. Can somebody please ...
2
votes
1answer
135 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 ...
83
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
76 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
72 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 &...
1
vote
1answer
45 views

Web Crypto API maturity for JavaScript RSA encryption?

We have been using a JavaScript crypto API to do RSA encryption in the browser. I know all the criticisms on encryption in JavaScript but we have evaluated pros and cons of the solution and the risks ...
1
vote
2answers
101 views

Is SQL Injection possible in String Concatenation When all Variables are created by the Program

Say I have a program that returns some date strings from a function in javascript. function getDates() { var yesterday = [some code that gets current time with yesterday's date]; var today = [...
4
votes
3answers
115 views

client/server trust after authenticating over HTTPS then dropping to plaintext?

Disclaimer If this question is ridiculous it's because secure public key exchange sounds impossible before you learn about it. So I'm asking about things that may be impossible. Question Is it ...
3
votes
3answers
187 views

Should I encrypt sensitive form data with JavaScript on the client?

This is by no means a replacement for HTTPS, so please do not assume that is why I am asking this question. I am exploring, and I am curious. I am looking for some expert input on this, and I am not ...
2
votes
1answer
56 views

Is it possible for page to get your installed extensions through javascript?

When you visit a page, could that page tell what extensions you are running if javascript is enabled? If so then could we stop them or at least make it extremely difficult to increase our privacy?
2
votes
1answer
37 views

Sandbox environments that performs analysis on obfuscated javascript code? [closed]

Are there any sandbox environments that performs analysis on obfuscated javascript code? For example, I have a piece of obfuscated JS code that executes perfectly but is impossible to un-obfuscate (...
1
vote
1answer
142 views

How to protect against skimmer attack like in the BA data breach

British Airways has suffered a big data breach allegedly because of a skimmer attack, whereby malicious javascript code was injected into their site. See https://www.bbc.co.uk/news/technology-...
-1
votes
1answer
151 views

Is it dangerous to use javascript:window.open in href tags?

I have a website and would like to create a link to share information on a third-party site. Is it safe to use the javascript:window.open() function to do this? If unsafe, are there any ways this ...
1
vote
1answer
122 views

How to increase the time for an offline password attack

I am trying to answer a CASP exam practice question. Could someone comment on the options below regarding the logic behind each item? Where is the logical error behind each statement? A Storage-...
0
votes
0answers
67 views

How to secure an API key from client side?

I'm having an issue and I'm pretty sure I'm not the first on that. I'm hoping to have a few great ways, hopefully bulletproof, to avoid any issues, so here it is. I provide an API that converts HTML ...
1
vote
4answers
130 views

Methods for storing plaintext passwords on a client

I have been tasked with some backend automation that needs to scrape data off an internal website using an employee's username/password to log in to the site. There is a backend database server, but ...
1
vote
1answer
161 views

How to store an user access token on a third party site in the front end

I am working on a wordpress plugin that provides a comment thread system kind of like disqus (but different). In order to login (to post comments) the workflow is like this : User clicks on log-in ...
0
votes
0answers
101 views

How can Web Crypto API and IndexedDB protect data stored on the client side against user manipulation?

Imagine web apps that are supposed to work with no or only a few interactions with the web server, for example: a browser game in which the player's level and progress are to be saved locally. a game,...
0
votes
2answers
108 views

XSS attack vsibible in html but no running

To test XSS for a certain website, username in the account settings to <script type="text/javascript">alert("XSS");</script>. In the html the code it is visible and but it's not running. ...
1
vote
1answer
44 views

Does the Web Cryptography API prevent a bad server from slurping cleartext?

Consider a cryptographic web application that relies on hosted JavaScript. This JavaScript could be manipulated server-side by a bad actor, defeating any cryptographic tasks. Namely: private keys ...
2
votes
1answer
75 views

Am I safe from XSS in React as long as I don't use dangerouslySetInnerHTML?

Let's say I write a webapp using React only, never touching the DOM directly. I never use dangerouslySetInnerHTML. Do I still have to worry about XSS? Or in other words, are there any other unsafe ...
0
votes
0answers
64 views

Encrypt HTML form fields before submitting over HTTPS

A certain payment gateway that I use allows two methods of integration: A hosted payment form, which you add to your website with an iframe. An API endpoint to send the payment details to using HTTPS ...
0
votes
1answer
73 views

How to securely erase JavaScript parameters after use? [duplicate]

When I pass a password as a parameter to a function, I presume it will end up on a stack or heap. When this function returns I'd expect that my password is still in memory somewhere until it is ...
0
votes
0answers
23 views

Stealing cookies from one site from an other site? [duplicate]

I would like to know if it is possible to get an entire dump of cookies from a users browser over the web, including those not from the site the malicious script was executed on and how somebody would ...
1
vote
1answer
25 views

Should untrusted strings be sanitized server-side if they're inserted into the document body through document.createTextNode?

Chat webapp. Clients (that is, web browsers) send messages to the server, which the server broadcasts to all connected clients. Client-side code looks like this: let p = document.createElement('p') p....
1
vote
1answer
46 views

What characters need to be escaped or replaced to prevent xss jsonp callback attacks?

I have a service which allows the user to specify a callback function name that wraps the data being returned to support jsonp callbacks. I want to make sure that I am covering all of my bases in ...
0
votes
0answers
38 views

difference between res.header(x-auth, JWTtoken) and res.cookies(JWTtoken)?

I have seen across all blogs and articles is that there is two ways to handle JWTtokens, put them inside localStorage which subjected for XSS attack or put them inside Cookies and set httpOnly and ...
0
votes
0answers
24 views

How to remove javascript malware in wordpress site? [duplicate]

I created a website in wordpress and suddenly realized malware in my site after google ads stopped and warned me. Below are the malwares found by sucuri sitecheck. <script type="text/javascript" ...
1
vote
1answer
73 views

Is it possible to send cookies from third party server to browser using CORS

UPDATED FROM THE LAST QUESTION WITH MORE DETAILS I'm building a full javascript app from Salesforce.com API with no server side script that will be hosted on salesforce.com domain (https) This app ...
0
votes
0answers
31 views

Drupal Site Compromised [duplicate]

My personal website Drupal compromised. I replaced all Drupal core modules. I scanned all malicious php scripts in sites folder, found some shells and removed. Now when i hosted in wamp there are ...
1
vote
0answers
191 views

Is this code as insecure as it looks? [closed]

The company I work for is looking for a payment processor. Ideally we want a fully and seamlessly integrated solution. I came across this from one of the recommended companies I had to look in to ...
0
votes
0answers
106 views

Can this function be trusted?

Suppose we have function that calls eval(); like this: <html> <head> <script> var obj = function(){ var bar = null; this.Setter = function(){ bar = 1 }; this....