cross-site

ESAPI for XSS prevention not working

白昼怎懂夜的黑 提交于 2019-11-30 05:57:00
I am working on fixing Cross site scripting issues in our code mainly in JSPS. Below is the original code //scriplet code <% String userId = request.getParameter("sid"); ...%> and in the same Jsp they have <input type = hidden name = "userID" value = "<%= userId %>" /> I have made changes to include esapi-2.1.0.jar in lib and ESAPI.properties, validation.properties in classpath. Then made below changes to scriplet code to fix the above code //scriplet code <% String userId = ESAPI.encoder().encodeForHTML(request.getParameter("sid")); ...%> I thought this would fix the issue but when I scan my

ASP.NET Core CORS request blocked; why doesn't my API apply the right headers?

好久不见. 提交于 2019-11-29 19:06:47
问题 Trying to set up CORS with authentication. I have a Web API site up at http://localhost:61000 and a consuming web application up at http://localhost:62000. In the Web API Startup.cs, I have: public void ConfigureServices(IServiceCollection services) { services.AddCors(o => o.AddPolicy("MyPolicy", corsBuilder => { corsBuilder.WithOrigins("http://localhost:62000") .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials(); })); IMvcBuilder builder = services.AddMvc(); // ... } // ... public void

ESAPI for XSS prevention not working

二次信任 提交于 2019-11-29 05:37:12
问题 I am working on fixing Cross site scripting issues in our code mainly in JSPS. Below is the original code //scriplet code <% String userId = request.getParameter("sid"); ...%> and in the same Jsp they have <input type = hidden name = "userID" value = "<%= userId %>" /> I have made changes to include esapi-2.1.0.jar in lib and ESAPI.properties, validation.properties in classpath. Then made below changes to scriplet code to fix the above code //scriplet code <% String userId = ESAPI.encoder()

Sending Text Cross Domain By Bookmarklet

有些话、适合烂在心里 提交于 2019-11-29 00:30:01
I need a user to navigate to a certain page that has a certain div full of useful text. Then click my bookmarklet and send the text in that div back to my server, which is different from the current domain. I have successfully inserted jQuery on the bookmarklet click and selected the text. Now I need to figure out a way to send that text cross domain to my server. I tried JSONP with jQuery and my text is too long for the url. My second idea was to open up a new window and load a page from my domain, and then somehow insert the selected text into the new window, after which the user could click

angularjs + cross-site scripting preventing

随声附和 提交于 2019-11-28 07:27:59
Is Angularjs takes care of XSS attack. I have read that ng-bind takes care. But When i try to do a sample to test that, it allows me to insert html tags in input type with ng-model...it didn't escape the Html tags. I have lot of input element in our page, which binds with ng-model, what should I do to make sure if I input a html tags ,angular ignores the html/scrip tags. ex. <input id="name" ng-model="name"></input> if I input as 'Hello, <b>World</b>!' $scope.name contains the same what I entered ,didn't exclude the tags. i.e var val = $scope.name; console.log(val); prints as same 'Hello, <b

Customise Tumblr's *new* Like Button iFrame {LikeButton}

我与影子孤独终老i 提交于 2019-11-28 06:37:51
The new code from tumblr {LikeButton} comes with a very few options: color and size. It injects an iFrame, which handles the "Like" functionality and provides SVG graphics. However because of the iframe and cross site scripting policies, it is no longer possible to alter it with css nor to edit its contents. How can I modify, or insert new code, to use my own Like button sprites or svgs? Styling a Tumblr Like Button Sadly, as the OP has stated the Tumblr like buttons have minimal visual options and are hard to target with CSS / javascript. So time for a new idea... The Idea We know two things:

Cross-site AJAX using jQuery

倖福魔咒の 提交于 2019-11-27 14:31:39
I have an existing jQuery plugin which makes a lot of AJAX calls (mostly JSON). I am wondering what is the quickest to allow it to do cross-site calls i.e. the $.get and $.post URL's will not be from the same domain. I have heard of JSONP, but was wondering if someone could give me an concrete example to go about the whole process. I want to make minimal changes if possible to my script. Should I use a proxy.php of sorts? Thank you for your time. Andrew Moore JSONP will allow you to do cross-site calls. See jQuery docs on that matter. The concept is simple: instead of doing a normal Ajax call,

angularjs + cross-site scripting preventing

旧时模样 提交于 2019-11-27 01:49:53
问题 Is Angularjs takes care of XSS attack. I have read that ng-bind takes care. But When i try to do a sample to test that, it allows me to insert html tags in input type with ng-model...it didn't escape the Html tags. I have lot of input element in our page, which binds with ng-model, what should I do to make sure if I input a html tags ,angular ignores the html/scrip tags. ex. <input id="name" ng-model="name"></input> if I input as 'Hello, <b>World</b>!' $scope.name contains the same what I

Customise Tumblr's *new* Like Button iFrame {LikeButton}

寵の児 提交于 2019-11-27 01:25:44
问题 The new code from tumblr {LikeButton} comes with a very few options: color and size. It injects an iFrame, which handles the "Like" functionality and provides SVG graphics. However because of the iframe and cross site scripting policies, it is no longer possible to alter it with css nor to edit its contents. How can I modify, or insert new code, to use my own Like button sprites or svgs? 回答1: Styling a Tumblr Like Button Sadly, as the OP has stated the Tumblr like buttons have minimal visual

Cross-site AJAX using jQuery

落花浮王杯 提交于 2019-11-26 22:24:21
问题 I have an existing jQuery plugin which makes a lot of AJAX calls (mostly JSON). I am wondering what is the quickest to allow it to do cross-site calls i.e. the $.get and $.post URL's will not be from the same domain. I have heard of JSONP, but was wondering if someone could give me an concrete example to go about the whole process. I want to make minimal changes if possible to my script. Should I use a proxy.php of sorts? Thank you for your time. 回答1: JSONP will allow you to do cross-site