Considerations for php (codeigniter) Security
1. httponly
The session must use httponly. Otherwise, it may be attacked by xxs. Use js to obtain the cookie session_id.
Use the ci_session of the framework, the longer digits, and httponly. These are
1 Check tool: Acunetix Web vulnerability Scanner V9 cracked version2 Check the vulnerability description results show:2.1 HTML Form without CSRF Protection2.2 Slow_http_dos2.3 If possible, you should set the SECURE flag for this cookie2.4 If
The birth of a cookie
Because the HTTP protocol is stateless, the server-side business must be stateful. The original purpose of cookies was to store state information in the Web to facilitate server-side use. For example, to determine whether the
https://www.jianshu.com/p/af8360b83a9f, don't use JWT anymore!ThoughtWorks China2017.08.16 08:51* words 2882 read 71543 reviews 172 Summary:
In Web apps, it's not a good idea to use JWT instead of a session
Usage Scenarios for JWT
Common security attacks include XSS, CSRF, SQL injection, and so on, XSS: cross-site scripting attacks
Cross-site scripting attacks (Cross Site scripting), which are not confused with abbreviations for cascading style sheets (cascading style Sheets,
We first look at the official sample code of the session in Express First$ NPM Install Redis$ redis-server var express = require ('.. /..'); var app = Express (); App.use (Express.logger (' dev ')); Required by session () middlewarePass the secret
Asp.net MVC security [note], asp. netmvc
1. Cross-site scripting (XSS)
1.1 Introduction
1.1.1 passive injection: Use html, javascript, and other information to forge links, use submitted information for images, and transfer pages
1.1.2 active
Asp.net MVC security [note], asp. netmvc
1. Cross-site scripting (XSS)
1.1 Introduction
1.1.1 passive injection: Use html, javascript, and other information to forge links, use submitted information for images, and transfer pages
1.1.2 active
XSS attacks when setting cookies
We all know that many XSS attacks aim to obtain users' cookie information. The most common method is to transmit cookies to other servers by setting src in js.
So how can we prevent js from getting cookies? Here is
Cookie Theft and session hijackingI. Basic Features of cookies
If you do not know the cookie, go to wikipedia to learn about it.Http request
Each request sent by the browser to the server carries a cookie:
Host: www.example.org
Cookie: foo = value1;
Tornado Web servers have been designed with a lot of security considerations, making it easier to guard against common vulnerabilities. Secure cookies prevent users' local status from being secretly modified by malicious code in their browsers. In
1. Cookie file format:
Cookie files are a bunch of TXT files in the cookies directory of the operating system. File Name format:@ numeric example .txtThat is, the same domain may have multiple cookie files:Elf@sohu1_12.16.txtElf@sohu%2%.txtElf@sohu%3
Problem description: With Google debugging can be seen, but with JS to read the time, has been prompted undefinedBackground code:var cookielogin = new HttpCookie ("Ticket", ticketlogin) {HttpOnly = True};cookielogin. Domain = ". qhlead.com";
A lot of XSS attacks occur when users enter unfriendly content where they can enter, and the underlying approach is to filter the input content.PHP or Java, basically have a ready-made JAR package or PHP framework, call to automatically filter the
One, the sensitive information stored in the cookie must be encrypted
Second, set HttpOnly to True
1, the function of this property value is to prevent the cookie value is read by the page script.
2, but setting the HttpOnly property, the HttpOnly
Phpcookie class (namespace used)
Share a php cookie operation class and use the namespace in php. this is relatively novel. For more information, see.A php cookie operation class provides basic operation functions: Creating a cookie,
Note: The following code should be tested in Firefox 3.5, Chrome 3.0, and Safari 4 versions. The implementation of IE8 is different from other browsing methods.2, pre-test requestThe preflight request first needs to send an HTTP OPTIONS request
7 Wrong security configurations in the Web. xml fileThere are a large number of articles on configuring authentication and authorization in the Java Web. xml file. Instead of re-explaining how to configure roles, secure Web resources, and set
This article is copyright to the author and the blog Park, Welcome to reprint, but without the consent of the author must retain this paragraph of the statement, and in the article page obvious location to the original link, blog address is
Cookie-related things, those rabbit things that year
This article is intended for readers who have basic knowledge about cookies.
Set cookie (HTTP Response Header)
Set-Cookie: {name }={ value}; path = {path}; domain = {domain}; expires = {expires},
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.