The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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.

Filter by
Sorted by
Tagged with
0
votes
1answer
76 views

Are there any security concerns with storing private keys in browser's javascript?

I'm working on a web app, and I know little about security/cryptography (for now, still learning) but I'm trying to set up a front-end where: At the very beginning, the user puts in their private key....
1
vote
1answer
62 views

Is there a security benefit to testing HTTP header presence with Javascript?

I have found in one of the client side libraries that it is performing an AJAX call to an API and checking if response contains all of the following headers with corresponding values (as a security ...
0
votes
0answers
102 views

Most efficient way to break md5? [migrated]

if you know the result of a hash, for this example the resulting hash is: ec664d1d65fd8a58c59b337b11c37a4d And you also know the hash has been made like this: const salt = "asdjbsdhal" const ...
0
votes
1answer
47 views

Server preventing colon character from being used

I have discovered an input field which accepts <img> and <h1> tags. I tried to use the events like onmouseover which is being stripped from the tag. Example: If the input is <img src="...
1
vote
1answer
76 views

Use a WHERE clause that's stored in a table?

Background: I have a workorder management system (WMS). The WMS has functionality that allows users to save queries. The queries are saved in a database table called QUERY (in a CLAUSE column). An ...
1
vote
1answer
75 views

How to store user credentials in browser securely?

I need help to authenticate User with user credentials. We are using Angular 5 as a front-end & need to store user's email and password if user checks on remember Me. autofill user credentials ...
0
votes
2answers
98 views

Can JavaScript from different origins communicate securely

I want to know if there is a way for JS from one Origin to delegate a task to JS from another origin in a secure way. The use case is to have a JS Agent from the users' home origin use the ...
2
votes
2answers
92 views

CSRF Clarification and Demystification

I understand how Cross-Site Request forgery happens, but I'm very unclear about how to protect against it using a SPA(React) application. For instance, my current strategy is to, on login, send a ...
1
vote
1answer
49 views

Using local files securely on website

I have a website on which users can select a file from their local machine, manipulate it and then save it. The website is written entirely in JavaScript to ensure it's purely client-side. Is the ...
-4
votes
1answer
77 views

I want to hide my youtube embeded code from my source code [closed]

I have iframe in my website i want it to be encrypted so that user can't understand the link and when user try to paste on browser it should show the video <iframe id="<?php echo $...
0
votes
3answers
84 views

Xss payload with onpointerover?

I bypassed a WAF and found an XSS vulnerability using the onpointerover event handler. In the page where I found the vulnerability, there's also a login page. What XSS payload can I use with the ...
1
vote
1answer
71 views

preventing cross iframe key logging in javascript

We have a web application, where other partners can include their pages as iframes. We implemented a server-to-server way of authenticating users for the iframes, but one partner doesn't want to ...
-2
votes
1answer
86 views

Can I inject javascript into a page via image?

Like so. Can I inject javascript into image urls, like this? <img src="javascript:alert("haha! you are hacked!">
1
vote
1answer
95 views

Why does javascript not show an alert box? [closed]

I'm trying to insert javascript:alert(1) inside tag. There is some kind of filter for javascript, so I tried using javascrip%74:alert(1) and that url is accepted. However when i click on it it ...
1
vote
1answer
64 views

Sending multiple Content-Length headers in a HTTP POST request using Javascript

I'm playing around with a self-xss bug that I believe I can escalate with a CSRF attack. However, the exploit relies on sending two identical Content-Length headers in a single POST request. ...
0
votes
1answer
75 views

How can i get an alert box from this?

While testing a website i noticed that the value of parameter username is reflected inside the javascript code of the response. It's insert into a variable like this one: var valueUser = "my-...
1
vote
1answer
49 views

Is a pure-JS raw RSA implementation secure for transferring information? [closed]

Assuming I have the RSA forge (javascript) library, does the pure-RSA implementation work for information transferring? I know that the forge library has the keysystem and everything, but I want to ...
1
vote
1answer
91 views

Exploiting stored XSS on Android app?

I'm testing Android app which is vulnerable to HTML injection, but I'm having problem escalating it to a stored XSS vulnerability. I have tried these, and many more: <script>alert(1)</...
1
vote
2answers
83 views

If I seed a CSPRNG with a truly random number and call the output, does this make the number more, less or equally “random”?

If I have a JavaScript CSPRNG such as isaac.random(), and I seed it using a truly random number T as such: isaac.seed(T), does this make the result of the CSPRNG more, less, or equally random? I ...
1
vote
1answer
71 views

What are some viable, secure sources of entropy for a CSPRNG?

I need some viable sources for entropy to seed a CSPRNG. So far, I have: JS Events Web Crypto API performance.now() Timing for xmlHTTPRequests etc. Are there any other viable/secure entropy sources ...
1
vote
1answer
75 views

Will this sandbox my user's javascript from my web IDE properly?

I'm working on an IDE that should run a user's JavaScript in the Browser. I don't want to just eval arbitrary code, especially as code may be shared between users. From here and other sources, I ...
1
vote
1answer
144 views

XSS in iframe can't access document cookies

I know of a website, lets call it website.com, that has these vulnerabilities: iframe injection: I can inject an iframe with a src attribute, but cannot inject any script directly. Lets say that this ...
2
votes
3answers
98 views

Is prototype pollution only exploitable on the back end?

I received a Jira as a result of a security scan asking to update lodash for CVE-2019-10744, which is a prototype pollution vulnerability. After reading this excellent paper about prototype pollution, ...
0
votes
0answers
26 views

Can I rely on Google id_token for web session?

I'm building a website without a "server": JavaScript and AWS Lambdas as back-end through API Gateway. Knowing there is no solution for session when using lambdas, I was wondering if I could only use ...
2
votes
1answer
81 views

In end-to-end encryption where should the asymmetric encryption keys be created?

I'm playing around with learning encryption with a mini messaging project, so far I can do symmetric encryption (AES) where everyone shares the same key, obviously not secure or ideal, I want to learn ...
2
votes
1answer
68 views

Can a javascript on parent page log keystrokes inside an iframe?

I am trying to analyze the possibility of accessing keystrokes from an iframe using a javascript running on the parent page. The potential attack which I am looking to verify is Cross Frame Scripting. ...
0
votes
1answer
45 views

Does A6 - Security Misconfiguration be reported for embedded JS? [duplicate]

We have a HTML file with a minified JSlibrary pasted inside with the license header and version number. Our client reported that it's a security risk (https://www.owasp.org/index.php/Top_10-2017_A6-...
2
votes
2answers
81 views

Understanding POST based XSS

I have been trying to learn about XSS, more specifically, POST based XSS. But I am unsure if I actually understand how POST based XSS works. With a GET, you can do XSS with the URL parameters, but to ...
10
votes
5answers
5k views

Running code generated in realtime in JavaScript with eval()

Consider a front-end JavaScript application where menu items needed to be shown or hidden based on somewhat simple logic (roles that user has and some other logical state). A simple language was ...
1
vote
1answer
128 views

Is there an XSS exploit to overcome stringification of all user input?

Question: Is stringifying all user input with something like JSON.stringify enough to prevent xss attacks? If not, is there an example of a xss exploit that overcomes this? Edit for clarification: ...
1
vote
0answers
21 views

CSP for iFrame without any src attribute

I am looking for recommendations on how to implement our CSP policy. We have an Angular SPA application, that has an iframe without any src attribute. We populate the content of the iframe dynamically ...
0
votes
0answers
23 views

Accessing a permitted file from local file system securely

I am working on project which has more focus on user data security. Public key cryptography is being used in this and private key is getting stored to user device locally (computer local file system). ...
1
vote
1answer
146 views

data:// uri XSS - using wrappers

Is there any way to load html data uri: data:text/html,<html><svg/onload=confirm(1)></html> with this scheme: data:// i have seen this payload going around: data://text/javascript,...
0
votes
0answers
70 views

Should I hash responses from server?

I am hashing all requests to my server with a secret token known by only the server and my mobile app to prevent malicious apps from using my servers. Should I also do this on the responses from the ...
1
vote
1answer
146 views

When signing up a new user, is there a way to secure the password using jQuery/PHP?

I'm of the opinion that HTTPS is sufficient for securing passwords from would-be MITM (man-in-the-middle) attacks, but I'm curious to know if there's anything else I should be doing. During signup, ...
0
votes
1answer
104 views

Predicting Math.random() sequence using V8's MWC1616 algorithm

If you have the seeds for Math.random() using mwc1616, are the random numbers generated in the same order every time / are they repeating? Basically wondering if, given a seed, can I predict past ...
0
votes
0answers
80 views

MPGS (Mastercard) Integration Security

According to MPGS integration guide, if merchant wants to display receipt when payment completed successfully, MPGS will redirect to merchant site callback URL with the resultIndicator. Merchant site ...
0
votes
0answers
21 views

Certificate Pinning with SockJS

What is the SockJS way of pinning SSL Certificates in the client side when contacting wss:// to avoid CA trust? FYI, when using modules like HTTPS or WS, we can listen to the socket event and then on ...
0
votes
0answers
33 views

Public report/telemetry API

I want to implement a telemetry data sender into my electron app. The API which I want to connect to is public. So any crash reports or any other data from the user is sent to it. The problem is how ...
1
vote
1answer
90 views

Securing a Node.js REST API for React.js webapp as well as a standalone API

I'm trying to create a secure method of authentication for my Node.js REST API that will work both for direct API requests as well as from my React.js web application. I've done some reading on how to ...
-2
votes
1answer
121 views

How to block or stop redirection with window.location?

I need to block redirection using window.location on my site. Some hacker has injected a stored XSS script into my site: if(my_username != 'Name') window.location = 'https://the url'; Now each ...
0
votes
2answers
64 views

Security implications of injection in api http request from frontend?

In my frontend I have something like this: article = httpLibrary.get('api.mysite.com/articles/' + articleId); Where articleId is taken from a URL query parameter (it's injectable). Is this ...
1
vote
1answer
285 views

How can Instagram cause Chrome to attempt to login and show me my username when I'm using incognito mode?

When I reach Instagram user pages while in Incognito mode, Chrome pops up a window with my non-incognito username asking whether or not to sign in. See screenshot below. Although I assume Chrome ...
0
votes
0answers
42 views

Can you trace the path a file upload path without manually executing it?

In a current bug bounty target I have found an unrestricted file upload, it just shoots whatever you give it through a multipart form, that being said I have full freedom of payloads to employ, how ...
-1
votes
1answer
66 views

Javascript with HTML for CSRF [closed]

<html> <h1>POC CSRF</h1> <form> Enter bWAPP Password:<input type="password" id="password" placeholder="password"> </form> ...
2
votes
2answers
199 views

Can javascript damage data and hardware?

I once had a script looking like the one below: window.open("SameSiteUrl"); alert("spamspamspam"); it had some strange laggy effects... Anyways, a friend "pranked" me by running the script overnight....
1
vote
1answer
383 views

Should I use ReCAPTCHA v2 or v3?

I've seen lots of SO posts and other articles on the internet about the differences between Google's ReCAPTCHA v2 and v3, but I'm not sure which one I should use. I'm looking to protect my website's ...
1
vote
1answer
109 views

Why are js libraries designed to be loaded in iframe?

I am developing a JavaScript library which users would include in their website. a common theme across 3rd party libraries is that they are loaded in a n iframe. (ex you tube) . Is there any specific ...
3
votes
1answer
74 views

javascript eval() clarification

I've read this article about eval security issues. I need a clarification about this particular situations: For example, imagine we had a web app with a text field input that we were running eval()...
-2
votes
1answer
145 views

How to protect my site from XSS

I own a chat site {https://trixac.com}. It uses BoomChat's code. Recently I banned a troll and now he is back and hes running XSS injections against my site and it's working for some odd reason. I've ...