Questions tagged [xss]

Cross-site scripting (XSS) is a type of computer security vulnerability typically found in web applications that enables malicious attackers to inject client-side script into web pages viewed by other users. An exploited cross-site scripting vulnerability can be used by attackers to bypass access controls such as the same origin policy.

Filter by
Sorted by
Tagged with
-4 votes
1 answer
85 views

My Javascript code is safe to prevent XSS?

I have a website where I put two input parameters in the error page for convenience The first parameter(code) is the error code The second parameter(desc) is the error text And both input parameters ...
Humble's user avatar
  • 1
0 votes
0 answers
45 views

XSS Filter encoding and decoding

How can I handle situations where the encoded value from the XSS filter implemented with org.owasp.encoder.Encode.forHtml(UserInput), needs to be decoded for specific use cases such as populating ...
Sangram G's user avatar
0 votes
1 answer
29 views

Should I sanitize response data before sending it to the client?

I'm using the express-xss-sanitizer package to sanitize incoming requests in my Node.js Express application. However, I'm still seeing issues reported by Checkmarx regarding potential XSS attacks. I'm ...
prashanthh's user avatar
0 votes
0 answers
40 views

Getting cookies from the browser console

There is a faculty member's host for a lab work on XSS vulnerability research. The first page is authorization, we do it manually. The second page has a text input field and a send button (but you can ...
rendoteru's user avatar
0 votes
0 answers
18 views

Does Express and/or Restify sanitize incoming data out of the box?

Hopefully this is a simple question, since it seems like a basic security step, but I haven't been able to find much info on what functions or modules to implement to escape dangerous characters and ...
ipenguin67's user avatar
  • 1,533
0 votes
0 answers
42 views

XSRF/CSRF protection in Angular - xsrfTokenExtractor.getToken(); returns null

.NET 7 WebAPI + Angular frontend. Sample response header from API call: Access-Control-Allow-Origin: * Cache-Control: no-cache, no-store Content-Type: application/problem+json; charset=utf-8 Date: Wed,...
jonantony's user avatar
0 votes
0 answers
38 views

How to send post request with Playwright and python

For example, if you go to https://brokencrystals.com site, and in the bottom you have subscriptions field, if you insert xss payload, you'll get an alert. In inspect element you'll see api request/...
Senad's user avatar
  • 1
-1 votes
1 answer
30 views

Send Dynamic JSON to DotNet Core Controller Action without XSS Vulnerability

I am sending json as a string to a controller action in the body of a PUT request. Our security scanner has identified this as an XSS vulnerability correctly and we can readily recreate this issue. I'...
msteel9999's user avatar
1 vote
0 answers
30 views

Unable to set up Content Security Policy for GTM script in NextJS V13.4.12 using next.config.js and middleware.ts

Getting error while setting up Content Security Policy in NextJS V13.4.12. Created middleware.ts as below: import { NextRequest, NextResponse } from 'next/server'; export const middleware = (request: ...
Dibyendu Saha's user avatar
0 votes
0 answers
39 views

Can Spring Boot help to prevent XSS in Rest API?

I have a Spring Boot 2.7.6 application with webflux instead of mvc. The application provides an Rest Api which accepts Content-Type application/json. Example Json Request: [ { "id": &...
user1350889's user avatar
0 votes
0 answers
11 views

Cross-site scripting: Any request results in error

I was playing around with my account in one particular website, and I tried to change my account name there (which was not possible in any other way, since the accounts were predefined before the ...
Alex Aramyan's user avatar
1 vote
1 answer
46 views

JWT (XSS) vs Cookies (CSRF)?

I'm a Python backend developer at a start-up. Recently, I was asked to build the authentication system for APIs, and I implemented a token-based authentication mechanism (JWT) using the FastAPI ...
BooRuleDie's user avatar
0 votes
0 answers
37 views

Xss prevention in JSP [duplicate]

XSS is well known vulnerability in JSP. There are lot of information on web (and on stack overflow) about preventing XSS in JSP. I have found printing user input with <c:out> is most commonly ...
LuMa's user avatar
  • 13
0 votes
0 answers
42 views

Does the HTTP request header Sec-Fetch-Mode value "navigate" indicate top-level navigation used in SameSite cookie policy?

Background: I'm working on an application where I'm looking into further restricting my cross-site cookies by modifying the default value for SameSite on my cookies. Before I make the change, I'm ...
melanie's user avatar
  • 607
0 votes
1 answer
57 views

CVE-2022-29548 on WSO2 Identity Server 6.1.0

We are using WSO2 Identity Server 6.1.0 and in our latest scans it has been reported of containing CVE-2022-29548: WSO2 Management Console XSS. It has been tested using "GET /carbon/admin/login....
SRUJAN ANNAM's user avatar
0 votes
0 answers
23 views

If a website doesn't use cookies or IP addresses for authentication, is it safe for it to set access-control-allow-origin: * on everything?

My understanding is that the same-origin policy needs to exist because browsers automatically send any cookies for bakery.com along with any request to bakery.com, including one that was initiated ...
Isaac King's user avatar
0 votes
0 answers
36 views

How to escalate or make a Self-XSS vulnerability more impactful when injecting a payload into the X-Forwarded-For header of a web request?

I'm a beginner bug bounty hunter, and I recently came across a Self-XSS vulnerability during my security testing on a target website. The vulnerability occurs when I inject a payload into the X-...
Giancarlo Eduardo's user avatar
0 votes
0 answers
117 views

No CSP found in enforcement mode

Im making sure my domainname is fast and safe. I tested this on Pagespeed.web.dev but it says "Ensure that the CSP is effective against XSS attacks". How do i add CSP (Content Security ...
Jord's user avatar
  • 1
0 votes
0 answers
47 views

xss attck in url and appending string in html body using url

In this URL there is a XSS attack: www.example.com/login.php/'%22--%3E%3CsVg/onLOad=document['body']['append'](%603cACF1BD%60['repeat'](2))%3E This decodes to www.example.com/login.php/'"-->&...
aniket patwa's user avatar
0 votes
0 answers
121 views

Sonarqube error: Change this code to not reflect user-controlled data

SonarQube is flagging the following code to not reflect user=controlled data. I understand the fix I have to implement (validate the url), but I don't know how to do it. In the code below, it doesn't ...
justinxhan's user avatar
0 votes
1 answer
29 views

apache 2 script-src permission issue in content security policy

I need to implement a content security policy for a customer. Everything works well except for the js scripts. I need to allow external js scripts. Code in my vhost apache : Header set X-Content-Type-...
Laurent Fourny's user avatar
0 votes
1 answer
110 views

XSS mitigation with url encoded input

In one of my application to mitigate XSS attack I am using Encoder for html from OWASP but unfortunately it is not sufficient. The pentesters have found a reflected cross site scripting threat where ...
NAVOZ's user avatar
  • 45
0 votes
0 answers
20 views

How do I protect against onmouseover from a WYSIWYG using react

I current have a WYSIWYG editor for basic formatting. I need to add some security measures to prevent XSS and any other JS from being added to the code but allow things like bold, underline, and ...
bstory's user avatar
  • 862
0 votes
0 answers
29 views

What steps should I take to properly protect user input in PHP? [duplicate]

What steps should I take to properly protect user input in PHP, so that I can prevent SQL injection and XSS attacks, while still allowing certain HTML tags? Is there a reliable function or method that ...
UpzOnline's user avatar
0 votes
0 answers
34 views

Is it safe to have a website where users can add HTML using tinyMCE? The final HTML will also be stored in a database [duplicate]

As a junior developer, I acknowledge my limited knowledge regarding web security. Recently, I integrated a basic tinyMCE editor into my company's website, enabling users to edit their profile page. ...
ZASH's user avatar
  • 9
0 votes
1 answer
48 views

Understanding Scroll To Text Fragment (STTF) Leak

The following contains spoliers to CSAW2023 CTF [The CTF is over but I still want to warn] Background In the recent CSAW2023 CTF, in a challenge called rainbow-notes we're given a website for writing ...
snatchysquid's user avatar
  • 1,282
0 votes
1 answer
48 views

How can I mitigate an inputHidden XSS vulnerability on JSF according to Fortify SAST?

Here, things are clear about what Fortify is finding as a vulnerability because it reports that an inputHidden could be vulnerable to XSS. I read another post about JSF mitigating this, and they said ...
emgi's user avatar
  • 1
0 votes
1 answer
53 views

Validate file content before upload

I'm developing a web application in Java, and I want to scan files uploaded to it at runtime for any type of injection, whether it's XSS, SQL, or malware. Besides, I have text fields in which users ...
Eduardo Roque's user avatar
0 votes
0 answers
28 views

Can changing a function inside a script tag in an html page using chrome developer tools work?

I am learning about websecurity particularly xss. Although I have done server side sanitization, I wanted to know upto what extent can client side sanitization protect me. So I am using DOMPurify for ...
hk1234's user avatar
  • 11
0 votes
1 answer
16 views

Htmlpurifier does not add some tags to the allowed ones

I want to configure htmlpurifier so that it allows tags in html. Htmlpurifier the whitelist with the tags table, tbody and does not work. On the official website in demo mode, the table tag is also ...
Robokop's user avatar
  • 31
0 votes
1 answer
48 views

Sime PHP-Script: XSS attack possible?

I found following code-snippet and want to prove, that it is not secure and instead, htmlentities() should be used, instead of this own implementation. Can someone see a attack-vector for $input, ...
Tream's user avatar
  • 1,049
0 votes
0 answers
19 views

Trying to escapeHtml Characters with Jsondeserializer in spring boot, But when ever it is persisting html escaping is happening more than once

lets consider this scenario. 1.I have created a deserializer class 2.used JsonDeserilizer anotation in POJO class. ----------up to now everything is going good---------- when request come to ...
Rajoli Hemanth Kumar's user avatar
0 votes
0 answers
25 views

How do I stop PHP XSS withing this anti SQL-injection script? [duplicate]

The script below is a script I¨ve found online, which should be Sql Injection safe. Id like someone to confirm this. My main question in this post is, how can I get this script XSS safe in the same ...
want2lrn's user avatar
1 vote
0 answers
30 views

When i pass this value to comments param, to api. Getting 403 forbidded in postman and web browser

"comments": "jdfjdskf <script>sss</script>", this param is available in my post request body. If I change any other value except <Script> it is working fine. For ...
Aravindh R's user avatar
0 votes
0 answers
102 views

Identifying Cross-site scripting (XSS) attack inside a .docx file using react

I am writing a file upload component for .docx files and i want to identify xss attacks inside them. The approach i am using is reading the text from the file and matching the html tags that could be ...
Nimantha Fernando's user avatar
0 votes
0 answers
275 views

How Can fix Checkmarx report : "Reflected XSS All Clients"?

I got repoprted 151 High rish "Reflected XSS All Clients" problems of my code. They all share the same patterns like below: 行114 153 source object:dtIn destination object:...
Wei Chung Shih's user avatar
0 votes
0 answers
36 views

Cant display pop-up with DVWA at level medium

i'm learning about Stored XSS and demo with DVWA. At level Medium, i've tried to summit " alert("Hacked") in field Name. But it doesnt display pop-up. i check page source and it's like ...
Phương Hoàng's user avatar
0 votes
1 answer
66 views

XSS formatting in javascript string

While learning xss I came across a write up on zseano hackerone ctf. The post illustrates embedding an alert call inside of the comment section. Forgive any misspeak but my understanding is; There is ...
Kenneth Cox's user avatar
0 votes
0 answers
77 views

Protection from cross-site-scripting Django Rest Framework

I am creating API for forum web-site with DRF and want to protect it from XSS. For example if someone sends a request with a text included in html tags(button, form, script etc.) it is saved in ...
Mihail Bury's user avatar
0 votes
0 answers
92 views

How to block only redirects via HTML meta tag with CSP

Scenario Given there's the following HTML markup, which is the result of a successfully XSS injection attempt: <!-- this meta tag was successfully injected/prepended --> <meta http-equiv=&...
Oliver Hader's user avatar
  • 4,126
0 votes
0 answers
50 views

How to properly escape this JSP code to avoid Stored XSS valnerabilities?

These are flagged as having "Stored XSS vulnerabilities". Need to know how to properly escape the following to address this type of cross site scripting vulnerability? out.print("<td ...
Wes's user avatar
  • 1,203
0 votes
1 answer
812 views

XSS Payload That Can Bypass Special Character Check

I developed the following C# algorithm to prevent XSS attacks: private bool Is_There_XSS_Payload(string arg) { Regex regex = new Regex(@"^[a-zA-Z0-9]+$"); bool result = ...
KosD's user avatar
  • 61
1 vote
3 answers
253 views

Java SonarQube: Error This use of java/io/PrintWriter.write(Ljava/lang/String;)V could be vulnerable to XSS

I am getting this error below. When using ResponseWriter. How can I resolve it? Goal is to resolve the Sonarqube error, however my proposed solution below using Sonar documentation isn't working. try {...
mattsmith5's user avatar
-1 votes
1 answer
57 views

Content-Security Header throwing me error

I am adding a Content-security-policy headers in my application by provide the following value of directive as the style-src:'unsafe-inline" script-src: www.googletagmanager; font-src: 'self' ...
Tushar's user avatar
  • 1
0 votes
0 answers
155 views

How to prevent XSS in an embed element?

I have the following React component which is vulnerable to XSS via the content inside the PDF when it is rendered. The component looks like this: import i18n from "i18next"; import React, { ...
Loupeznik's user avatar
  • 318
0 votes
0 answers
54 views

Using both the Authorization header and cookies in authentication?

Why is it not more common to use cookies as implicit authentication session handling? I'm new to web development, but I've seen the following pattern: 1. Authenticate with backend 2. Backend sends ...
sherrellbc's user avatar
  • 4,720
0 votes
0 answers
64 views

What is the difference between OWASP Java Encoder and OWASP Java HTML Sanitizer?

I need to handle user input in my Java application to protect against Cross Site Scripting (XSS) attacks. I found OWASP Java Encoder and OWASP Java HTML Sanitizer on the OWASP website. What's the ...
Poliano Martini's user avatar
0 votes
0 answers
62 views

How to make eval() inside of an iframe safe?

My goal (without the use of webapps or Node.js) is to have it so that I can run user-created Javascript code that can reference external libraries (ie. Google Maps API), send variables from the main ...
128912891289's user avatar
2 votes
1 answer
72 views

Is it safe to use python str.format method with user-submitted templates in server-side?

I am working on project where users must be able to submit templates containing placeholders to be later rendered to generate dynamic content. For example, a user might submit a template like: "${...
G. Bittencourt's user avatar
0 votes
0 answers
40 views

Cross Site Scripting with uploading XML files

I have an application that contains a functionality to upload different types of XML files. I have implemented cross site scripting detection and prevention in the application using the HTMLSanitizer ...
Ghyath Serhal's user avatar

1
2 3 4 5
90