security

Saving photos and videos using Android FileProvider to the gallery

杀马特。学长 韩版系。学妹 提交于 2021-02-19 06:54:06
问题 My application (using SDK less than 24) can take photos and video using the camera. The photos and videos can be viewed in the gallery outside the app. SDK 24 and above requires FileProvider to create the uri for saving the photo or video to the gallery. Prior to SDK 24 I would use a uri and an intent to take a photo: private void openCameraForResult(int requestCode){ Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); picturesDirectoryPhotoFileName = nextFileName(); File photoFile =

Dealing with session hijacking in PHP

谁说胖子不能爱 提交于 2021-02-19 06:07:07
问题 Reading through the many questions regarding session hijacking here on Stackoverflow, I've gathered that the only 'solution' to validating a users session is by checking the user agent, which is such a weak layer of protection that I don't even bother to implement it. So, I was wondering what solutions you guys have implemented? Are you even using PHP's native sessions or is there a more secure solution? 回答1: You don't need the session id in order to hijack a session. An XSS attack can go 1

Dealing with session hijacking in PHP

青春壹個敷衍的年華 提交于 2021-02-19 06:06:36
问题 Reading through the many questions regarding session hijacking here on Stackoverflow, I've gathered that the only 'solution' to validating a users session is by checking the user agent, which is such a weak layer of protection that I don't even bother to implement it. So, I was wondering what solutions you guys have implemented? Are you even using PHP's native sessions or is there a more secure solution? 回答1: You don't need the session id in order to hijack a session. An XSS attack can go 1

Why do browsers allow setting some headers without CORS, but not others? Trying to avoid preflights

只愿长相守 提交于 2021-02-19 04:31:29
问题 I'm trying to avoid0 CORS preflight requests for authorized GET requests, for latency performance reasons. The simple way to do that is putting the access token in a URL query parameter, but this is a bad security practice1. According to this answer2, the goal of browsers is to block anything that couldn't already be accomplished with HTML tags like img or script . But if that's the case, why is it allowed to set headers like Accept or Content-Langage ? You can't set those on an img tag. Also

Why do browsers allow setting some headers without CORS, but not others? Trying to avoid preflights

风流意气都作罢 提交于 2021-02-19 04:31:27
问题 I'm trying to avoid0 CORS preflight requests for authorized GET requests, for latency performance reasons. The simple way to do that is putting the access token in a URL query parameter, but this is a bad security practice1. According to this answer2, the goal of browsers is to block anything that couldn't already be accomplished with HTML tags like img or script . But if that's the case, why is it allowed to set headers like Accept or Content-Langage ? You can't set those on an img tag. Also

Symfony2 - Dynamic Role Management

女生的网名这么多〃 提交于 2021-02-19 04:28:25
问题 I'm working on a CRM which will feature advanced authorization and the management of users in groups that have a specific role in the system. Basically, what I'd like to do is this: Manage Dynamic Authorization for (Domain) Models / Controllers / Action Manage Dynamic Authorization For Objects and Fields. I know about ROLE_xxxx in the security.yml file but I'd rather not hardcode the roles. For example, I'd like to have a sort of matrix/grid where a super administrator can create custom

Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA

我的未来我决定 提交于 2021-02-19 04:09:45
问题 I've been following this tutorial to add SSH Certification to my site. However at the moment this method does not work for the time-being due to a security flaw, so here is the alternate method. I'm trying to implement the alternate code-paste: sudo certbot --authenticator webroot --webroot-path <path to served directory> --installer nginx -d <domain> however am not sure what to put in <path to served directory> . Is the "path to served directory" the nginx config? Would it look something

Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA

痴心易碎 提交于 2021-02-19 04:09:28
问题 I've been following this tutorial to add SSH Certification to my site. However at the moment this method does not work for the time-being due to a security flaw, so here is the alternate method. I'm trying to implement the alternate code-paste: sudo certbot --authenticator webroot --webroot-path <path to served directory> --installer nginx -d <domain> however am not sure what to put in <path to served directory> . Is the "path to served directory" the nginx config? Would it look something

How do I force tomcat to reload trusted certificates?

試著忘記壹切 提交于 2021-02-19 03:22:47
问题 My WebApp uses a Connector for 2-Way SSL (aka "Client Authentication"): <Connector port="8084" SSLEnabled="true" maxThreads="10" minSpareThreads="3" maxSpareThreads="5" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="true" truststoreFile="conf/keystore.kst" truststoreType="JCEKS" sslProtocol="TLS" URIEncoding="UTF-8" keystoreFile="conf/keystore.kst" keystoreType="JCEKS" keyAlias="myAlias" ciphers="TLS_RSA_WITH_AES_128_CBC_SHA,TLS

How do I force tomcat to reload trusted certificates?

穿精又带淫゛_ 提交于 2021-02-19 03:22:28
问题 My WebApp uses a Connector for 2-Way SSL (aka "Client Authentication"): <Connector port="8084" SSLEnabled="true" maxThreads="10" minSpareThreads="3" maxSpareThreads="5" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="true" truststoreFile="conf/keystore.kst" truststoreType="JCEKS" sslProtocol="TLS" URIEncoding="UTF-8" keystoreFile="conf/keystore.kst" keystoreType="JCEKS" keyAlias="myAlias" ciphers="TLS_RSA_WITH_AES_128_CBC_SHA,TLS