security

Detecting Ajax in PHP and making sure request was from my own website

纵然是瞬间 提交于 2020-01-09 01:59:42
问题 I use my PHP back-end to detect AJAX requests by checking for a value in $_SERVER['HTTP_X_REQUESTED_WITH'] . This gives me a reliable detection, making sure the request is made utilizing AJAX techniques. How can I make sure the request came from my own domain, and not an external domain/robot? www.example.com/ajax?true could allow anyone to make an AJAX call and cut the information. I could make sessions for everyone that enters my website normally, and then allow AJAX calls.. but that can be

Disable cross domain web security in Firefox

杀马特。学长 韩版系。学妹 提交于 2020-01-09 01:55:30
问题 In Firefox, how do I do the equivalent of --disable-web-security in Chrome. This has been posted a lot, but never a true answer. Most are links to add-ons (some of which don't work in the latest Firefox or don't work at all) and "you just need to enable support on the server". This is temporary to test. I know the security implications. I can't turn on CORS on the server and I especially would never be able to allow localhost or similar. A flag, or setting, or something would be a lot better

Disable cross domain web security in Firefox

[亡魂溺海] 提交于 2020-01-09 01:55:06
问题 In Firefox, how do I do the equivalent of --disable-web-security in Chrome. This has been posted a lot, but never a true answer. Most are links to add-ons (some of which don't work in the latest Firefox or don't work at all) and "you just need to enable support on the server". This is temporary to test. I know the security implications. I can't turn on CORS on the server and I especially would never be able to allow localhost or similar. A flag, or setting, or something would be a lot better

Using Active Directory to restrict access to data in webforms app (mainly through populating dropdowns)

你离开我真会死。 提交于 2020-01-07 14:32:09
问题 Please review the scenario and solution I came up with. If it sucks please tell me so. Scenario Need to create an application for submitting & viewing accidents reports that will be used by 50 schools. When submitting a form, an employee will select their school from a dropdown. Likewise when viewing accident reports, the employee will select their school from a dropdown. Some employee's are to be assigned multiple schools. Thus the dropdown needs to be populated with each school they are

Using Active Directory to restrict access to data in webforms app (mainly through populating dropdowns)

北城以北 提交于 2020-01-07 14:31:59
问题 Please review the scenario and solution I came up with. If it sucks please tell me so. Scenario Need to create an application for submitting & viewing accidents reports that will be used by 50 schools. When submitting a form, an employee will select their school from a dropdown. Likewise when viewing accident reports, the employee will select their school from a dropdown. Some employee's are to be assigned multiple schools. Thus the dropdown needs to be populated with each school they are

Hide wp-content from URL

大兔子大兔子 提交于 2020-01-07 09:32:56
问题 So 2 days ago I launched our city website here and tried checking for some vulnerabilities using an online wordpress vulnerabillity scanner based on WPScan and I got this result: As you can see, the first one shows my installation directory and the name of my theme. The url given by the first one is http://tuguegaraocity.gov.ph/wp-content/themes/citygov/ which shoes the name of my theme also. Is there a way that I can hide this? Or any other good way to make it safer. Thank you! 回答1: This

Spring MVC, Spring Security and Hibernate cannot autowire properties between contexts

南楼画角 提交于 2020-01-07 08:19:11
问题 I am using Spring MVC 3.0.6 and Spring security 3.0.7. I cannot @Autowire the RoleDao class to my user class when in the security context. my web.xml file: <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/root-context.xml /WEB-INF/security-app-context.xml </param-value> </context-param> <!-- Creates the Spring Container shared by all Servlets and Filters --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener

Spring MVC, Spring Security and Hibernate cannot autowire properties between contexts

孤人 提交于 2020-01-07 08:19:08
问题 I am using Spring MVC 3.0.6 and Spring security 3.0.7. I cannot @Autowire the RoleDao class to my user class when in the security context. my web.xml file: <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/root-context.xml /WEB-INF/security-app-context.xml </param-value> </context-param> <!-- Creates the Spring Container shared by all Servlets and Filters --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener

Will Identity fail if I assign roles and every time I use User.Identity.GetUserId()?

喜夏-厌秋 提交于 2020-01-07 07:37:06
问题 I want to create web portal, where there will be multiple users of 3-4 types. So I have created roles in Startup.cs Like public void Configuration(IAppBuilder app) { ConfigureAuth(app); createRolesandUsers(); } // In this method we will create default User & roles private void createRolesandUsers() { ApplicationDbContext context = new ApplicationDbContext(); var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context)); var UserManager = new UserManager<ApplicationUser

Sanitize user submitted HTML but keep safe embedded iframes

别说谁变了你拦得住时间么 提交于 2020-01-07 05:53:11
问题 I need to sanitize user inputs of malicious html & submitted by CKEditor . I currently use owasp-java-html-sanitizer . for this purpose but it removes embedded iframes as well. But I have genuine use cases like embedding a YouTube video or slide share presentation within posts. How could I allow such embedded iframes safely? I use Java. 回答1: You will need to allow the iframe element and source attribute to your Html policy. You can do it like the following example modified from the java doc /