security

Ember best practices for loading javascript/app only after authentication

雨燕双飞 提交于 2019-12-24 02:37:04
问题 Starting a new Ember app and was prepared to follow token authentication type structure for authentication in the restricted API routes but was then told we need to not show any of the javascript (or as absolute little as possible) before authentication. This has me a little puzzled given single page javascript apps. I'm using the, very helpful, ember-app-kit which has great tools that compile everything down to a minified and obfuscated single javascript file, which I thought was good enough

Why does React.js' API warn against inserting raw HTML?

拈花ヽ惹草 提交于 2019-12-24 02:18:40
问题 From the tutorial But there's a problem! Our rendered comments look like this in the browser: " <p>This is <em>another</em> comment</p> ". We want those tags to actually render as HTML. That's React protecting you from an XSS attack. There's a way to get around it but the framework warns you not to use it: ... <span dangerouslySetInnerHTML={{__html: rawMarkup}} /> This is a special API that intentionally makes it difficult to insert raw HTML, but for Showdown we'll take advantage of this

Re-fill posted form data via PHP securely

£可爱£侵袭症+ 提交于 2019-12-24 02:14:00
问题 How can I ref-fill posted form data via PHP in the event of an error. I have a contact form and the user enters a bunch of information and if one field doesn't validate, he loses everything. How can I stop this from happening and make sure it is secure? I've tried this, but believe I read somewhere it is not secure: <input type="text" name="name" value="<?php echo $_POST['name']; ?>" /> 回答1: One issue is that if $_POST['name'] contains a " , then the value can 'escape' out and rewrite the

Is there a way to process sensitive data in memory securely on Android?

谁说胖子不能爱 提交于 2019-12-24 02:10:03
问题 I am working with some content which I decrypt from a file in Android and which needs to remain for the entire duration of the application in memory. Is this a security risk from crackers? If so, does Android offer some form of in-memory protection of sensitive content similar to Windows' process secure memory access protection mechanism? I am not looking for storage via SharedPreferences in Private mode, I would need some memory zone which is inaccessible for tampering. Would storing data in

Secured Client-Side script

核能气质少年 提交于 2019-12-24 02:00:55
问题 I have got a particular requirement where some critical algorithms have to be handled in the client-side script and it got to be secured. Using javascript will just expose the algorithm. I am currently evaluating ways to secure the algorithm on the client script. Appreciate any suggestions and alternative approaches. One option I am thinking about is to download a small applet to the local PC, get the calculations done in it and update the results back. Before deciding on this, I want to know

Is this client side application secure?

佐手、 提交于 2019-12-24 01:58:12
问题 Here is a simplified version of a program I am using to work with a file using javascript on the client side. HTML: <input id='myinput' type='file' accept='.png, .jpg, .jpeg' /> Javascript: var myinput = document.getElementById('myinput'); myinput.addEventListener('change', function(e) { /* 1. capture the file */ var file = e.target.files[0]; /* 2. make a fileReader object */ var reader = new FileReader(); /* 3. the load event listener */ reader.addEventListener('load', function(e) { var

Weblogic - java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.JCEMac$DES9797Alg3

爷,独闯天下 提交于 2019-12-24 01:55:16
问题 I am working with a Java Web application and I need to generate a MAC using 3DES algorithm. Code is working without problems on a Weblogic 10.3 but the problem came when I tried to run the application in a different Weblogic, similar version (10.3.1). This is my code: public String getMac(String inkey, String data) throws Exception { byte[] out = new byte[8]; try { // if I commend this line, the result is the same Security.addProvider(new BouncyCastleProvider()); // this loop proves the BC

Weblogic - java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.JCEMac$DES9797Alg3

六眼飞鱼酱① 提交于 2019-12-24 01:55:12
问题 I am working with a Java Web application and I need to generate a MAC using 3DES algorithm. Code is working without problems on a Weblogic 10.3 but the problem came when I tried to run the application in a different Weblogic, similar version (10.3.1). This is my code: public String getMac(String inkey, String data) throws Exception { byte[] out = new byte[8]; try { // if I commend this line, the result is the same Security.addProvider(new BouncyCastleProvider()); // this loop proves the BC

OAuth - Error on Twitter (could not authenticate)

半腔热情 提交于 2019-12-24 01:55:06
问题 I have written a class (so I could learn how OAuth works). It is working fine; I can retrieve the access token with the class. But when I try to post an update, it says that I'm not authenticated! What am I doing wrong here? // By Kevin Jacobs class OAuth { private $url = null; private $debug = false; private $method = 'POST'; private $oauthData = array(); private $data = array(); private $token = array('key' => '', 'secret' => ''); private $consumer = array('key' => '', 'secret' => ''); /**

How to pass claims from custom IAuthorizationPolicy to current ServiceSecurityContext

独自空忆成欢 提交于 2019-12-24 01:26:18
问题 I have custom security token and custom IAuthorizationPolicy , like this: public class TestAuthorizationPolicy : IAuthorizationPolicy { public TestAuthorizationPolicy(string name, string someData, string moreData) { this.Name = name; this.SomeData = someData; this.MoreData = moreData; var claims = new[] { new Claim("http://text.example.com/Claims/Name", this.Name, Rights.Identity), new Claim("http://text.example.com/Claims/SomeData", this.SomeData, Rights.PossessProperty), new Claim("http:/