标签: securityexception

Silverlight SecurityException

我正在将数据发布到服务器并成功执行BeginGetRequestStream,然后是EndGetRequestStream,将我的POST数据写入填充RequestStream,并调用BeginGetResponse.

BeginGetResponse成功返回,然后我调用:

Dim response As HttpWebResponse = CType(MyHttpRequest.EndGetResponse(asynchronousResult), HttpWebResponse)
Run Code Online (Sandbox Code Playgroud)

此行抛出以下SecurityException错误:

{System.Security.SecurityException ---> System.Security.SecurityException:安全错误.
System.Net上的System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
,System.Net.Browser.AsyncHelper上的<> c__DisplayClass5.b__4(Object sendState)
.<> c__DisplayClass2.b__0(Object sendState)

---内部异常堆栈跟踪的结尾---
在System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod,对象状态)
在System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult的asyncResult)
在EtsyV2NetSL.WebQuery.POST_ResponseCallback( IAsyncResult asynchronousResult)}

所以我的第一个想法是我被服务器用clientaccesspolicy.xml或crossdomain.xml阻止.我已经解雇了Fiddler并看到了以下内容:

GET http://openapi.etsy.com/clientaccesspolicy.xml > 596 (text/xml)
GET http://openapi.etsy.com/crossdomain.xml > 200 OK (application/xml)
Run Code Online (Sandbox Code Playgroud)

所以我检查了他们的crossdomain.xml,设置显示正常:

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
   <allow-access-from domain="*"/>
</cross-domain-policy>
Run Code Online (Sandbox Code Playgroud)

我试图解决这个问题已经走到了尽头.我在VS的开发机器上运行测试应用程序.

有没有人有任何想法为什么Silverlight会抛出这个错误?

谢谢

securityexception silverlight-4.0

5
推荐指数
1
解决办法
5865
查看次数

使用隔离存储时,SecurityException未处理

使用此代码时,我收到以上错误:

        var userSettings = new UserSettings()
        {
            Username = TextBox_Username.ToString(),
            Password = TextBox_Password.ToString(),
            Operator = OperatorList.O2
        };

        var settings = IsolatedStorageSettings.ApplicationSettings;
        settings.Add("UserSettings", userSettings);
        settings.Save();
Run Code Online (Sandbox Code Playgroud)

我不知道为什么?虽然.

c# securityexception windows-phone-7

5
推荐指数
1
解决办法
1627
查看次数

SecurityException - 共享主机上的Dapper

对于我目前的项目,我使用Dapper.一切都很完美.然后我需要在共享主机上部署它.结果可以在这里看到(复制YSOD):

说明:应用程序尝试执行安全策略不允许的操作.要授予此应用程序所需的权限,请与您的系统管理员联系或在配置文件中更改应用程序的信任级别.

异常详细信息:System.Security.SecurityException:请求类型'System.Security.Permissions.ReflectionPermission,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的权限失败.

堆栈跟踪

[SecurityException:请求类型'System.Security.Permissions.ReflectionPermission,mscorlib,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的权限失败.] System.Security.CodeAccessSecurityEngine.Check(Object demand,StackCrawlMark&stackMark ,Boolean isPermSet)+0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap,StackCrawlMark&stackMark)+31
System.Security.CodeAccessPermission.Demand()+46
System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Type owner,StackCrawlMark&stackMark,Boolean skipVisibility)+9461551
System.Reflection.Emit.DynamicMethod..ctor(String name,Type returnType,Type [] parameterTypes,Type owner,Boolean skipVisibility)+40 Dapperx.SqlMapper.CreateParamInfoGenerator(Identity identity)+537 Dapperx.SqlMapper.GetCacheInfo (身份标识)+376 Dapperx.d__13 1..ctor(IEnumerable 1 source)+58 Dapperx.SqlMapper.Query(IDbConnection cnn,String sql,Object param,IDbTransaction transaction,Boolean bu ffered,Nullable 1 commandType)+199 ...1.MoveNext() +644
System.Collections.Generic.List
1 collection) +327 System.Linq.Enumerable.ToList(IEnumerable
1 commandTimeout, Nullable

有没有办法解决它(在.NET 4.0中)?据我所知,到目前为止我所阅读的内容,提供商必须允许一些部分反映IIS,这可能会对他们造成安全风险......

asp.net securityexception shared-hosting .net-4.0 dapper

5
推荐指数
1
解决办法
701
查看次数

使用Zxing条形码扫描程序会导致SecurityException

我在我的应用程序中使用Zxing Barcode Scanner启动,Intent以便我可以扫描条形码并将数据恢复到我的应用程序.很基本的东西; 它已经工作了很长时间没问题.我最近通过Play获得了一个错误报告,其中包含以下堆栈跟踪:

    java.lang.SecurityException: Permission Denial: starting Intent 
{ act=com.google.zxing.client.android.SCAN cmp=com.ups.mobile.android/com.google.zxing.client.android.CaptureActivity } 
from ProcessRecord{421bafc8 11687:edu.byu.dburner.lendablefree/10141} 
(pid=11687, uid=10141) not exported from uid 10137
    at android.os.Parcel.readException(Parcel.java:1327)
    at android.os.Parcel.readException(Parcel.java:1281)
    at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1736)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1383)
    at android.app.Activity.startActivityForResult(Activity.java:3281)
    at edu.byu.dburner.lendable.xxxxx.xxxx$2.onClick(xxxxxx.java:539)
    at android.view.View.performClick(View.java:3644)
    at android.view.View$PerformClick.run(View.java:14313)
    at android.os.Handler.handleCallback(Handler.java:605)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:4514)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
    at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)

据我所知,堆栈跟踪存在一些问题com.ups.mobile.android,即使用Zxing应用程序的UPS应用程序.我尝试在同一部手机上安装UPS应用程序并触发onClick发生问题的事件.除了选择条件要求我选择条形码扫描应用程序或UPS应用程序以执行此操作之外,没有任何重大事件发生Intent.我唯一的猜测是,我们的两个应用程序都发生了某种冲突,一次只有一个人可以使用条形码扫描程序包,从而导致SecurityException.但这对我来说没有多大意义,因为我可以做到没问题,而且我想很多人都有多个使用Zxing安装的应用没有问题.

有没有人深入了解导致此错误的原因以及我可以采取哪些措施来解决此错误?

编辑:Per SeanOwen的评论,如果您特别遇到Barcode Scanner的麻烦,请务必使用IntentIntegrator.它们提供了一种内置方法setTargetApplications.您可以使用它来Intent使用实际的条形码扫描仪应用程序:setTargetApplications(IntentIntegrator.TARGET_BARCODE_SCANNER_ONLY);简单的馅饼.

android securityexception barcode zxing android-intent

5
推荐指数
1
解决办法
1820
查看次数

Android:securityException:"目标必须在外部存储上"

我已经彻底搜索了网络以找到答案,但没有结果.

我已在我的Android应用中实现了一些"偏好设置",包括在任何您想要的位置保存文件的功能.

如果我选择所谓的"集成SD卡"上的路径,一切都OK.但我也有一个"真正的"外部SD卡,安装(对我来说)/storage/sdcard1符号链接到/extSdCard/mnt/extSdCard(虽然"内部" SD卡是/storage/sdcard0用符号链接/sdcard/mnt/sdcard).

在ICS上我有外部/emmc加上一些我不记得的链接.

问题是,如果我选择指向此的路径extSdCard,应用程序将创建文件夹结构,但不会写入下载的文件,以"SecurityException"结尾,"目标必须在外部存储上".

但这条路径在外部存储上!更多:如果存在写入权限的问题,为什么要创建文件夹?(android.permission.WRITE_EXTERNAL_STORAGE出现在清单中).

我很可能做错了什么; 或者也许是一些bug?

Eclipse日志:

11-30 11:58:29.143: D/ShareActivity(24752): doInBackground...
11-30 11:58:33.813: D/ShareActivity(24752): The response is: 200
11-30 11:58:50.283: D/ShareActivity(24752): location: Downloads
11-30 11:58:50.443: D/ShareActivity(24752): User defined folders created
11-30 11:58:50.443: D/ShareActivity(24752): path: /storage/sdcard1/temp
11-30 11:59:07.053: D/ShareActivity(24752): downloadUri: file:/storage/sdcard1/temp/test.3gpp
11-30 11:59:07.313: D/AndroidRuntime(24752): Shutting down VM
11-30 11:59:07.318: W/dalvikvm(24752): threadid=1: thread exiting with uncaught exception (group=0x41ce3300)
11-30 11:59:07.318: E/AndroidRuntime(24752): …
Run Code Online (Sandbox Code Playgroud)

mobile android securityexception

5
推荐指数
1
解决办法
7732
查看次数

Java JCE无法在jarsplice创建的jar中验证提供者BC

我正在开发一款游戏,我正在使用Slick2D库.我也使用bouncycastle进行加密.然后我使用jarsplice将所有内容打包在一个漂亮的可执行文件中.它运行正常,直到它需要加密某些东西.它给了我一个java.lang.SecurityException: JCE cannot authenticate the provider BCAnd我正在使用一个签名的jar文件(http://www.bouncycastle.org/download/bcprov-jdk15on-150.jar)

这是堆栈跟踪

 java.lang.SecurityException: JCE cannot authenticate the provider BC
    at javax.crypto.Cipher.getInstance(Cipher.java:642)
    at javax.crypto.Cipher.getInstance(Cipher.java:580)
    at net.matrixstudios.zenerith.networking.ZenerithLogin.encryptLogin(ZenerithLogin.java:159)
    at net.matrixstudios.zenerith.networking.ZenerithLogin.<init>(ZenerithLogin.java:112)
    at net.matrixstudios.zenerith.MultiplayerMenu$1.performAction(MultiplayerMenu.java:90)
    at net.matrixstudios.zenerith.gui.menu.MenuGameState.clickButton(MenuGameState.java:83)
    at net.matrixstudios.zenerith.gui.menu.MenuGameState.checkForButtonClicks(MenuGameState.java:75)
    at net.matrixstudios.zenerith.gui.menu.MenuGameState.update(MenuGameState.java:51)
    at net.matrixstudios.zenerith.gui.menu.AbstractGameState.update(AbstractGameState.java:47)
    at org.newdawn.slick.state.StateBasedGame.update(StateBasedGame.java:266)
    at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:663)
    at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:411)
    at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:321)
    at net.matrixstudios.zenerith.gui.Window.<init>(Window.java:28)
    at net.matrixstudios.Main.main(Main.java:28)
Caused by: java.util.jar.JarException: file:/C:/Users/M4trixSh4d0w/Desktop/Zenerith_Alpha.0.2.1.5.jar has unsigned entries - org/bouncycastle/LICENSE.class
    at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:462)
    at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:322)
    at javax.crypto.JarVerifier.verify(JarVerifier.java:250)
    at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:161)
    at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187)
    at javax.crypto.Cipher.getInstance(Cipher.java:638)
    ... 14 more
Run Code Online (Sandbox Code Playgroud)

那么如何验证要运行的jar文件呢?这是一个独立的可执行jar文件.

java securityexception

5
推荐指数
1
解决办法
1万
查看次数

android.speech.RecognitionService SecurityException 与一些 3rd 方语音识别器

我们创建了一个使用 Google 语音识别器的 Android 应用程序,我们首先在程序中选择使用 Google 语音识别器。大多数设备工作正常,只有少数设备(MEIZU_M5、U78-E、Apollo Lite 等)报告以下异常。好像和联发科的语音指令有些冲突?我们发现其他一些联发科的设备工作正常。这很混乱。

java.lang.SecurityException: Not allowed to bind to service Intent { act=android.speech.RecognitionService cmp=com.mediatek.voicecommand/.service.VoiceWakeupRecognitionService }
at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1421)
at android.app.ContextImpl.bindService(ContextImpl.java:1385)
at android.content.ContextWrapper.bindService(ContextWrapper.java:604)
at android.speech.SpeechRecognizer.startListening(SpeechRecognizer.java:287)
Run Code Online (Sandbox Code Playgroud)

为了跟踪代码,源代码只显示到 ContextWrapper.java。如何让它显示到 ContextImpl.java:1421?

通过 firebase 日志,我们发现它发生在许多 3rd 方语音识别器上:

com.mediatek.voicecommand
com.htc.android.voicedictation
com.vlingo.midas
com.iflytek.speechcloud
com.iflytek.speechsuite
...
Run Code Online (Sandbox Code Playgroud)

我们还测试了其他一些运行良好的第 3 方语音识别器。那些导致异常的语音识别器是否仅用于系统语音命令而应用程序无法访问?

欢迎任何想法或经验。

android speech-recognition securityexception device sfspeechrecognizer

5
推荐指数
1
解决办法
899
查看次数

java.lang.SecurityException:类"XYZ"的签名者信息与同一包中其他类的签名者信息不匹配

我有一个applet,它在浏览器中运行,并从Javascript调用.有两个类:PortalLauncherParamSplitter,它们都在默认包中.JavaScript调用的方法PortalLauncher这反过来又调用一个函数ParamSplitter.小程序在一个签名的jar中.

这大部分时间都有效.但是,一些用户不时会遇到问题.在当天的某个时间(即不在第一次访问时),抛出以下异常:

java.lang.SecurityException: class "ParamSplitter"'s signer information does not
    match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(Unknown Source)
    at java.lang.ClassLoader.preDefineClass(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$000(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at PortalLauncher.openFile(PortalLauncher.java:313)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) …
Run Code Online (Sandbox Code Playgroud)

java applet securityexception

4
推荐指数
1
解决办法
2万
查看次数

使用SecuritySafeCritical函数的C#完全受信任的程序集仍在抛出SecurityExceptions

我正在尝试创建一个沙盒AppDomain来加载扩展/插件.我有一个MarshalByRefObject,它在appdomain中实例化以加载dll.我在尝试加载dll时遇到SecurityExceptions,我无法弄清楚如何绕过它们,同时仍然限制第三方代码可以做什么.我的所有项目都是.net 4.

InDomainLoader类位于完全受信任的域中,该方法标记为SecuritySafeCritical.从我读过的所有内容来看,我认为这应该有效.

这是我的Loader类,它创建AppDomain并跳转到它:

public class Loader
{
    public void Load(string dll, string typeName)
    {
        Log.PrintSecurity();

        // Create new AppDomain
        var setup = AppDomain.CurrentDomain.SetupInformation;
        var permissions = new PermissionSet(null);
        permissions.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
        var strongname = typeof(InDomainLoader).Assembly.Evidence.GetHostEvidence<StrongName>();
        var strongname2 = typeof(IPlugin).Assembly.Evidence.GetHostEvidence<StrongName>();
        AppDomain domain = AppDomain.CreateDomain("plugin", null, setup, permissions, strongname, strongname2);

        // Create instance
        var loader = (InDomainLoader)domain.CreateInstanceAndUnwrap(
            typeof (InDomainLoader).Assembly.FullName, typeof (InDomainLoader).FullName);

        // Jump into domain
        loader.Load(dll, typeName);
    }
}
Run Code Online (Sandbox Code Playgroud)

这是在域中运行的引导加载程序:

public class InDomainLoader : MarshalByRefObject
{
    [SecuritySafeCritical]
    public void Load(string dll, string …
Run Code Online (Sandbox Code Playgroud)

c# securityexception appdomain

4
推荐指数
1
解决办法
4625
查看次数

GWT:XSRF:偶尔丢失X-GWT-Permutation标头

我的应用程序收到GWT在RemoteServiceServlet.checkPermutationStrongName()找不到X-GWT-Permutation HTTP Header 时偶然发生的XSRF攻击错误HttpServletRequest.发生错误时,日志文件中会出现以下行:

WARNING: doUnexpectedFailure was invoked.
java.lang.SecurityException: Blocked request without GWT permutation header (XSRF attack?)
Run Code Online (Sandbox Code Playgroud)

在托管模式和Web模式下,Firefox 3.x和4.0都遇到了这个问题.

我运行了Live Headers,确实缺少HTTP头.

该应用程序是vanilla GWT RPC.

有任何想法吗?

失败标题

http://127.0.0.1:8888/org.drools.guvnor.Guvnor/guvnorService

POST /org.drools.guvnor.Guvnor/guvnorService HTTP/1.1
Host: 127.0.0.1:8888
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2.15) Gecko/20110303 Ubuntu/10.10 (maverick) Firefox/3.6.15
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Length: 154
Content-Type: text/x-gwt-rpc; charset=utf-8
Referer: http://127.0.0.1:8888/org.drools.guvnor.Guvnor/Guvnor.html?gwt.codesv...
Cookie: standalone_usage=true
Pragma: no-cache
Cache-Control: no-cache


7|0|4|http://127.0.0.1:8888/org.drools.guvnor.Guvnor/|
6808FDC8A4FA3491026441B59E4DB72A|
org.drools.guvnor.client.rpc.RepositoryService|subscribe|1|2|3|4|0|

HTTP/1.1 400 Bad Request …
Run Code Online (Sandbox Code Playgroud)

firefox gwt securityexception gwt-rpc

4
推荐指数
1
解决办法
3870
查看次数