Questions tagged [json]

JSON (JavaScript Object Notation) is an open standard for encoding data in both human-readable and machine-readable form, usually for transmission to or from a web API. Use this tag for security issues relating to the format itself, or where the fact that the data is json-formatted is core to the question. For questions about web APIs where the security issue does not depend on the data format, please use [api]

Filter by
Sorted by
Tagged with
1 vote
1 answer
36 views

How to prevent replay attacks with JWE?

I am used to using JWTs so when I needed the same behavior but with no plaintext user data I looked at JWE. JWE is very similar to JWT; however, I did not see the exp, nbf or iat fields which limit ...
0 votes
0 answers
46 views

Accidentally locked an XSS vulnerable input

On https://ais.osym.gov.tr/ I saw an XSS vulnerable input. I tried some payloads without malicious intent which only contained alerts or console logs. The code img \x00src=x onerror=alert(1) worked. ...
2 votes
2 answers
198 views

Is a user query containing the string "\u0600\u0000bՕR" suspicious/malicious?

Recently, one of my services received a query where the JSON payload contained the string <an-arabic-character>\u0000bՕR. The service handled it gracefully so no real harm was done, but am I ...
  • 131
0 votes
1 answer
112 views

Is it possible to get xss in json body request?

I was doing a VAPT assessment in which I see some JSON body in the request which has orgid deviceid So there any possibility to get XSS in json body?
0 votes
0 answers
57 views

How to find a potential JSON Java deserialization code vulnerability with a whitebox approach in web server source code?

I would like to know a somewhat general approach for white box vulnerability scanning, mainly focused around Java deserialization code bugs that could lead to RCEs (Remote Code Execution following ...
0 votes
0 answers
93 views

Decrypting Data field of HTTP2 packet in Wireshark

I have pcap file that consists of HTTP/2 requests. Communication between two machines used basically done through Encryption using JSON Web Encryption (JWE) and encapsulate and encapsulates the ...
  • 1
1 vote
0 answers
107 views

Re-populate form with JSON data

I re-populate form with JSON data via javascript (all data has the same origin server) 1 Wen the page load, make a request post ajax 2 The response Ajax is a: Object { primary_ns: {…}, secondary_ns: {…...
0 votes
0 answers
200 views

Storing encrypted data inside a JSON array in MySQL?

I have the following the situation: I have some data structures which look like this: { id: int name: BLOB password: VARCHAR(80) ... } There it is easy to store the encrypted fields ...
9 votes
4 answers
3k views

Is a backend API server vulnerable to CSRF?

We recently ran a Veracode SAST scan on our application and discovered that it has a CSRF. However, I wanted to check whether this is really true or it's just a false positive. Our application is a ...
  • 193
0 votes
0 answers
36 views

How does "./" affects signature generation for files, in a PHP based web application?

I am solving a lab related to serialization vulnerabilities. It deals with retrieving files based on the signature. The theory of the lab states as quoted, "Adding ./ will still give you the same ...
0 votes
1 answer
161 views

JWT to prevent others from using video in their iframes

I just recently discovered JWT to secure my live stream and have done successful token on server and player but I think it still can be stolen. How I can use it to only have the domains I choose to be ...
  • 1
0 votes
2 answers
269 views

CSRF attack when form data isn't parsed

How can you do a CRSF attack on express if it only accepts JSON? Sample Node app: const express = require('express'); const app = express(); app.use(express.json()); app.post('/item', (req, res, ...
0 votes
1 answer
213 views

Purpose of two-way encryption of JWE

If we look at encryption format and standards of JWE following RFC-7516, we can see that it uses a 2 way encryption method. So what are the benefits of this compared to just using RSA? Are computation ...
0 votes
1 answer
89 views

Shared Text Content - XSS Safe

I have a bulletin on my site that all valid users have access to (read and write). User input posted to this bulletin is stored in JSON. Because of these qualities there is definitely some concern for ...
1 vote
0 answers
150 views

Can input value escape a JSON object?

I am passing value from input filled directly into a script function inside a JSON object. I was thinking, is it possible that this input can escape this object and can lead to XSS or something. <...
  • 136
0 votes
1 answer
603 views

Signing HTTP requests with JWS

Looking over the spec for JSON Web Signature (JWS), I realise that it doesn't seem to specify anything that is HTTP-specific in terms of the payload. Specifically, signing HTTP headers and bodies (say,...
0 votes
1 answer
888 views

AES encryption (in Java) of different JSON strings always produce same encrypted string as result. Why? [closed]

I have a program written in Java which takes JSON string as argument, encrypts it using AES then encodes it using Base64. JSON string is like: {"a": "b"} or {"a": "n"} or {"a": "k"} I.e related ...
  • 101
11 votes
4 answers
6k views

JSON API response flagged as XSS by vulnerability scanner. Is this a false positive?

When a user attempts to access any URL without authentication (including a non-existent URL), my web service returns an HTTP 401 response. This response is JSON encoded, and the body of this response ...
  • 213
0 votes
0 answers
297 views

Unable to exploit SQL injection in the parameter

During my testing I have found a vulnerable parameter in an API (/api/v1/documents/?direction=desc&limit=30&mode=reports**&page=1**) and its parameter is page=1 at the end. Upon giving the ...
1 vote
1 answer
297 views

Json hijacking does not work [duplicate]

I have patched my site to prevent JSON hijacking. During this process, I was interested to see if I could actually exploit this vulnerability. So I created a foo.html, added a script tag which source ...
2 votes
1 answer
94 views

Code Change That Resulted in Database Fields and Values Exposed

At my company, we have a new development team that has been completely rewriting all of the code for different parts of the system. I've noticed that with one of the recent changes, you can now see ...
1 vote
1 answer
3k views

Storing third party API tokens in a database

Currently I have a Node JS project that uses the Spotify API. The project displays the users top played artists and tracks. I am following the Authorization Code Flow to obtain the access token. This ...
0 votes
0 answers
437 views

Method to bypass \n in WAF (\n vulnerability)

I have this application that has an input box where the data is going to be sent in a JSON format. The JSON payload might look like this {“message”: “hello\nmy name is andi”} But the problem is the ...
0 votes
1 answer
141 views

Bypassing Access-Control-Allow-Headers header [closed]

What i want to do is access the Content-type header which is placed under the Access-Control-Allow-Headers header as i want to attempt to change json to xml on a web application im working on to check ...
0 votes
0 answers
352 views

How to make a HTTPrequest in JSONP callback?

I'm trying an XSS challenge. I found an exploit that breaks CSP by using a JSONP callback. I can get an alert to pop up by putting something like: <script src="https://whitelisted.jsonp?callback=...
  • 1
0 votes
0 answers
178 views

Unsafe deserialization from JSON

Seeking any example of exploitable unsafe deserialiazation where the serialized format is json and not some binary format. Even better would be an example where calling a Java constructor of an ...
  • 1,672
0 votes
0 answers
206 views

XSS PoC for JSON

When I am requesting for a password reset, it's making a request like this -> {"eval":"uiFormNotify('messageDiv', 'info', 'msg.email_reset_to_existing', 10);Metronic.unblockUI('#forgotPwdForm');$('#...
  • 1
1 vote
1 answer
819 views

Should I report this Google API key disclosure issue or not?

I have been asked to perform a pentest on a website from a company. I was analyzing the javascript files they were using, and I found a link pointing to: https://www.googleapis.com/customsearch/v1/...
0 votes
0 answers
294 views

Loading JSON via an unvalidated URL - is this a vulnerability?

I have a webpage that is running some javascript that: Reads in a URL from a URL query param Without validating the URL, makes a request to it Validates the response - ensures that the response is a ...
  • 2,646
0 votes
0 answers
613 views

JSON-CSRF using Flash SWF Doesn't make POST request

I was trying to recreate a POC where an endpoint didn't have CSRF protection and was exposing a form submission. So, I have read these ( before asking here ): Vimeo hackerone Report by avlidienbrunn ...
8 votes
3 answers
5k views

Encoding output in JSON HTTP API

I'm the author of a JSON REST API. This REST API is consumed by various clients, such as HTML/JS-clients, .NET clients (console applications) and Ruby clients. The output of the API is in JSON format, ...
2 votes
3 answers
1k 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 ...
-1 votes
2 answers
3k 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 ...
  • 2,579
2 votes
0 answers
137 views

Is Jil vulnerable to Friday The 13th JSON attack?

Is the .NET JSON (de-)serializer Jil vulnerable to Friday The 13th JSON attack when deserializing untrusted input? If this attack is applicable, how can it be prevented? Explanation of the attack: ...
  • 131
1 vote
1 answer
598 views

What are a JSON rest api's responsibilities to prevent XSS? [duplicate]

I'm building a rest API that serves exclusively JSON. It might one day be consumed by a browser based app. Is there anything I should do on my end to prevent XSS attacks?
3 votes
1 answer
6k views

Sanitizing JSON deserialization

I'm currently investigating best practices for secure JSON deserialization of untrusted input for object mapping. After researching, it seems like... the default jackson mapper: https://...
0 votes
2 answers
5k views

What are the security concerns for base64 encoded JSON files? [closed]

In a REST API, I'd like to receive images as base64 encoded strings in a JSON objects fron user's post and save them to disk using node.js fs module. The request body are objects like: { file: '...
  • 135
1 vote
1 answer
539 views

Is using JSON a secure way of handling sql queries in python?

The question I will try to articulate this as clearly and best I can: Suppose that I have a python program which connects to a database on a server. Next I ask you to consider that this python ...
3 votes
2 answers
2k views

Why does "<!--<script>" in a JS string cause a broken page/denial of service for that page?

I was under the impression that all I needed to do to make inline JSON safe was to break any closing </script> tags in strings, e.g. escape the / like <\/script>. However I found a weird ...
  • 161
0 votes
1 answer
184 views

Is there a way to send a password over JSONP (GET) over HTTPS (SSL)? Crypto maybe?

I understand sending passwords in the clear over GET is not considered secure because the query string can be logged by multiple eavesdroppers. However if I REALLY need to use JSONP to submit a ...
  • 101
1 vote
3 answers
22k views

SQL Injection on POST JSON request

I have a web application vulnerable to SQL injections. I'm using BurpSuite to intercept the requests. More specifically, the data variable below is vulnerable. I added my own data to aggregates and ...
1 vote
1 answer
670 views

How to exploit escapable JSON parameters

I have an HTML page with this bit of code in it: <div> <div id="login-container" class="login-container"> <login-page params="{&quot;redacted&quot;:&quot;redacted&...
  • 481
5 votes
3 answers
10k views

XSS breaking out of JSON.parse and href attribute

I have a pretty complicated case where I try to perform a stored XSS attack when uploading a jpg file with malicious filename. Whitespace is being filtered but it seems single and double quotes along ...
  • 524
-1 votes
1 answer
4k views

AES-CBC then SHA vs AES-GCM for encrypting and authenticating a web token

I am trying to have something like JWT but kinda ad hoc and encrypted. The token itself is simply a stringified JSON that contains the user id and unix timestamp. Now, I tried to use AES-128-GCM, ...
  • 123
80 votes
6 answers
154k views

Why would I ever use AES-256-CBC if AES-256-GCM is more secure?

I guess the gist of my question is: Are there cases in which CBC is better than GCM? The reason I'm asking is that from reading this post by Matthew Green, and this question on cryptography stack ...
1 vote
1 answer
2k views

Provide json post data in form based authentification

ZAP provides a way to turn a login (POST) request into a logging pattern (through the "mark as ..." in context menu). When the data is something like "user=toto&psswd=t@T°", it will translate it ...
  • 115
1 vote
2 answers
714 views

How can I use a MitM attack to modify intercepted contents on the fly? (educational)

I'm trying to start learning about pentesting, and for my first self-learning project, I want to intercept communication between a client (Laptop) and a server (Ubuntu). They are communicating through ...
2 votes
3 answers
929 views

How do I prevent XSS in direct access to AJAX/JSON APIs?

In my rich client, I escape user-provided data before rendering to prevent XSS. The data comes from the server unescaped. That is necessary for application logic, e.g., avoiding situations where I ...
26 votes
4 answers
11k views

What is the difference between JWT and encrypting some json manually with AES?

What is the difference between using a JSON Web Token (JWT) and simply having an AES key and sending and receiving encrypted JSON from the client? For example, this could be sent to the client: ...
  • 393
5 votes
0 answers
99 views

Is there a good way to store OAuth2 tokens for a native application?

Currently I have a native PC application that builds and uploads a configuration to an embedded Linux device (i.e. the client). This device connects to Google Calendar via their OAuth2 API. The ...
  • 151