{"id":247,"date":"2013-12-24T13:14:37","date_gmt":"2013-12-24T06:14:37","guid":{"rendered":"http:\/\/ethaizone.com\/blog\/?p=247"},"modified":"2013-12-24T13:14:37","modified_gmt":"2013-12-24T06:14:37","slug":"laravel-4-security","status":"publish","type":"post","link":"https:\/\/ethaizone.me\/blog\/2013\/12\/laravel-4-security\/","title":{"rendered":"Laravel 4 Security"},"content":{"rendered":"<p>\u0e08\u0e32\u0e01\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e01\u0e48\u0e2d\u0e19\u0e17\u0e35\u0e48\u0e40\u0e04\u0e22\u0e40\u0e02\u0e35\u0e22\u0e19 <a title=\"Laravel Security\" href=\"http:\/\/ethaizone.com\/blog\/2013\/01\/laravel-security\/\" target=\"_blank\">Laravel Security<\/a> \u0e0b\u0e36\u0e48\u0e07\u0e43\u0e19\u0e15\u0e2d\u0e19\u0e19\u0e31\u0e49\u0e19\u0e1c\u0e21\u0e22\u0e31\u0e07\u0e43\u0e0a\u0e49 Laravel 3 \u0e2d\u0e22\u0e39\u0e48 \u0e41\u0e15\u0e48\u0e17\u0e38\u0e01\u0e27\u0e31\u0e19\u0e19\u0e35\u0e49\u0e15\u0e49\u0e2d\u0e07\u0e1a\u0e2d\u0e01\u0e40\u0e25\u0e22\u0e27\u0e48\u0e32 Laravel 4 \u0e19\u0e31\u0e49\u0e19\u0e40\u0e22\u0e35\u0e48\u0e22\u0e21\u0e21\u0e32\u0e01\u0e46 \u0e41\u0e25\u0e30\u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e23\u0e27\u0e21\u0e16\u0e36\u0e07 Laravel 4.1 \u0e17\u0e35\u0e48\u0e14\u0e35\u0e02\u0e36\u0e49\u0e19\u0e44\u0e1b\u0e2d\u0e35\u0e01 \u0e41\u0e15\u0e48\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e01\u0e32\u0e23 update \u0e2d\u0e2d\u0e01\u0e08\u0e30\u0e2a\u0e30\u0e17\u0e49\u0e32\u0e19\u0e2b\u0e19\u0e48\u0e2d\u0e22\u0e43\u0e19\u0e42\u0e1b\u0e23\u0e40\u0e08\u0e47\u0e04\u0e02\u0e19\u0e32\u0e14\u0e43\u0e2b\u0e0d\u0e48<\/p>\n<p>\u0e27\u0e31\u0e19\u0e19\u0e35\u0e49\u0e1c\u0e21\u0e08\u0e30\u0e40\u0e02\u0e35\u0e22\u0e19\u0e2d\u0e34\u0e07\u0e2b\u0e31\u0e27\u0e02\u0e49\u0e2d\u0e40\u0e14\u0e34\u0e21 \u0e08\u0e30\u0e44\u0e14\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e02\u0e49\u0e2d\u0e40\u0e1b\u0e23\u0e35\u0e22\u0e1a\u0e40\u0e17\u0e35\u0e22\u0e1a\u0e01\u0e31\u0e1a Laravel 3 \u0e44\u0e14\u0e49\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e04\u0e23\u0e17\u0e35\u0e48\u0e01\u0e33\u0e25\u0e31\u0e07\u0e15\u0e31\u0e14\u0e2a\u0e34\u0e19\u0e43\u0e08\u0e27\u0e48\u0e32\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e14\u0e35\u0e2b\u0e23\u0e37\u0e2d\u0e44\u0e21\u0e48 \u0e42\u0e14\u0e22\u0e1c\u0e21\u0e08\u0e30\u0e40\u0e02\u0e35\u0e22\u0e19\u0e2d\u0e34\u0e07 Laravel 4 \u0e0b\u0e36\u0e48\u0e07\u0e43\u0e19\u0e14\u0e49\u0e32\u0e19\u0e04\u0e27\u0e32\u0e21\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22\u0e19\u0e31\u0e49\u0e19\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e41\u0e15\u0e01\u0e15\u0e48\u0e32\u0e07\u0e01\u0e31\u0e1a 4.1 \u0e2a\u0e31\u0e01\u0e40\u0e17\u0e48\u0e32\u0e44\u0e23<\/p>\n<p>1.\u00a0CSRF protection \u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e1b\u0e25\u0e2d\u0e21\u0e41\u0e1b\u0e25\u0e07 http request \u0e17\u0e35\u0e48\u0e40\u0e23\u0e35\u0e22\u0e01\u0e02\u0e49\u0e32\u0e21\u0e40\u0e27\u0e47\u0e1a\u0e44\u0e0b\u0e15\u0e4c \u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e19\u0e35\u0e49 Laravel \u0e21\u0e35\u0e1b\u0e49\u0e2d\u0e07\u0e01\u0e31\u0e19\u0e2d\u0e22\u0e39\u0e48\u0e41\u0e25\u0e49\u0e27 \u0e42\u0e14\u0e22\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07 Token \u0e44\u0e27\u0e49\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a \u0e2b\u0e32\u0e2d\u0e48\u0e32\u0e19\u0e44\u0e14\u0e49\u0e17\u0e35\u0e48\u00a0<a href=\"http:\/\/laravel.com\/docs\/security#protecting-routes\" target=\"_blank\">CSRF protection<\/a>\u00a0\u0e41\u0e15\u0e48\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e04\u0e19\u0e17\u0e35\u0e48\u0e40\u0e02\u0e35\u0e22\u0e19 Route \u0e41\u0e1a\u0e1a Controller \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e02\u0e35\u0e22\u0e19 filter \u0e44\u0e27\u0e49\u0e17\u0e35\u0e48 Controller \u0e41\u0e1a\u0e1a\u0e19\u0e35\u0e49\u0e44\u0e14\u0e49 (\u0e44\u0e21\u0e48\u0e21\u0e35\u0e43\u0e19 doc)<\/p>\n<pre class=\"brush:php\">$this-&gt;beforeFilter('csrf');<\/pre>\n<p>2.\u00a0Cookie Security \u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e19\u0e35\u0e49\u0e44\u0e21\u0e48\u0e15\u0e48\u0e32\u0e07\u0e08\u0e32\u0e01 Laravel 3 \u0e21\u0e32\u0e01\u0e04\u0e23\u0e31\u0e1a \u0e2b\u0e32\u0e2d\u0e48\u0e32\u0e19\u0e44\u0e14\u0e49\u0e17\u0e35\u0e48\u00a0<a href=\"http:\/\/laravel.com\/docs\/requests#cookies\" target=\"_blank\">Cookies<\/a>\u00a0\u0e0b\u0e36\u0e48\u0e07\u0e08\u0e23\u0e34\u0e07\u0e46 \u0e15\u0e49\u0e2d\u0e07\u0e1a\u0e2d\u0e01\u0e23\u0e27\u0e21\u0e46 \u0e27\u0e48\u0e32\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e48\u0e32\u0e07\u0e46 \u0e02\u0e2d\u0e07 Laravel 4 \u0e17\u0e31\u0e49\u0e07 Cookie Session \u0e08\u0e30\u0e16\u0e39\u0e01\u0e40\u0e02\u0e49\u0e32\u0e23\u0e2b\u0e31\u0e2a\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 \u0e17\u0e33\u0e43\u0e2b\u0e49\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e19\u0e31\u0e49\u0e19\u0e1b\u0e25\u0e2d\u0e14\u0e20\u0e31\u0e22\u0e04\u0e23\u0e31\u0e1a \u0e41\u0e15\u0e48\u0e16\u0e49\u0e32\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e17\u0e32\u0e07\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e40\u0e0a\u0e34\u0e07\u0e25\u0e36\u0e01 \u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e2b\u0e49\u0e41\u0e01\u0e30\u0e42\u0e04\u0e49\u0e14\u0e14\u0e39\u0e04\u0e23\u0e31\u0e1a<\/p>\n<p>3.\u00a0SQL-Injection \u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e19\u0e35\u0e49\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e17\u0e49\u0e32\u0e27\u0e04\u0e27\u0e32\u0e21\u0e40\u0e25\u0e22 \u0e21\u0e35\u0e1b\u0e49\u0e2d\u0e07\u0e01\u0e31\u0e19\u0e44\u0e27\u0e49\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e01\u0e31\u0e19 \u0e42\u0e14\u0e22 Laravel \u0e08\u0e30\u0e17\u0e33\u0e07\u0e32\u0e19\u0e1c\u0e48\u0e32\u0e19 PDO \u0e2b\u0e32\u0e2d\u0e48\u0e32\u0e19\u0e44\u0e14\u0e49\u0e17\u0e35\u0e48\u00a0<a href=\"http:\/\/php.net\/manual\/en\/pdo.prepared-statements.php\" target=\"_blank\">PDO\/Prepared statements and stored procedures<\/a>\u00a0\u0e2a\u0e23\u0e38\u0e1b\u0e43\u0e2b\u0e49\u0e2a\u0e31\u0e49\u0e19\u0e46 \u0e04\u0e37\u0e2d \u0e16\u0e49\u0e32\u0e40\u0e23\u0e35\u0e22\u0e01\u0e17\u0e33\u0e07\u0e32\u0e19\u0e1c\u0e48\u0e32\u0e19 Fluent \u0e2b\u0e23\u0e37\u0e2d Eloquent \u0e21\u0e31\u0e19\u0e01\u0e47\u0e08\u0e30\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e43\u0e2b\u0e49\u0e40\u0e2a\u0e23\u0e47\u0e08 \u0e0b\u0e36\u0e48\u0e07\u0e43\u0e19 Laravel 4 \u0e22\u0e31\u0e07\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e02\u0e35\u0e22\u0e19 query \u0e14\u0e34\u0e1a\u0e44\u0e14\u0e49\u0e2d\u0e22\u0e39\u0e48 \u0e41\u0e15\u0e48\u0e21\u0e31\u0e19\u0e40\u0e1b\u0e47\u0e19\u0e2a\u0e34\u0e48\u0e07\u0e17\u0e35\u0e48\u0e44\u0e21\u0e48\u0e41\u0e19\u0e30\u0e19\u0e33\u0e43\u0e2b\u0e49\u0e17\u0e33\u0e04\u0e23\u0e31\u0e1a \u0e40\u0e23\u0e32\u0e08\u0e36\u0e07\u0e44\u0e21\u0e48\u0e40\u0e2b\u0e47\u0e19\u0e2b\u0e31\u0e27\u0e02\u0e49\u0e2d\u0e02\u0e2d\u0e07\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07 raw query \u0e16\u0e39\u0e01\u0e1e\u0e39\u0e14\u0e43\u0e19 doc \u0e0b\u0e31\u0e01\u0e40\u0e17\u0e48\u0e32\u0e44\u0e23 (\u0e16\u0e39\u0e01\u0e43\u0e2b\u0e49\u0e04\u0e27\u0e32\u0e21\u0e2a\u0e33\u0e04\u0e31\u0e0d\u0e25\u0e14\u0e25\u0e07)<\/p>\n<p>4.\u00a0XSS \u0e2b\u0e23\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e41\u0e17\u0e23\u0e01\u0e42\u0e04\u0e49\u0e14\u0e44\u0e21\u0e48\u0e1e\u0e36\u0e48\u0e07\u0e1b\u0e23\u0e30\u0e2a\u0e07\u0e04\u0e4c\u0e25\u0e07\u0e2b\u0e19\u0e49\u0e32\u0e40\u0e27\u0e47\u0e1a \u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e19\u0e35\u0e49 Laravel \u0e44\u0e21\u0e48\u0e21\u0e35\u0e01\u0e32\u0e23\u0e1b\u0e49\u0e2d\u0e07\u0e01\u0e31\u0e19\u0e04\u0e23\u0e31\u0e1a \u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e40\u0e14\u0e34\u0e21\u0e04\u0e23\u0e31\u0e1a \u0e40\u0e1e\u0e23\u0e32\u0e30 PHP \u0e01\u0e47\u0e21\u0e35\u0e1f\u0e31\u0e07\u0e04\u0e4c\u0e0a\u0e31\u0e48\u0e19\u0e1e\u0e37\u0e49\u0e19\u0e10\u0e32\u0e19\u0e21\u0e32\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e1b\u0e49\u0e2d\u0e07\u0e01\u0e31\u0e19\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e1e\u0e27\u0e01\u0e19\u0e35\u0e49\u0e41\u0e25\u0e49\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u00a0<a href=\"http:\/\/php.net\/manual\/en\/function.strip-tags.php\">strip_tags()<\/a>\u00a0and\u00a0<a href=\"http:\/\/php.net\/manual\/en\/function.htmlentities.php\">htmlentities()<\/a>\u00a0\u0e14\u0e31\u0e07\u0e19\u0e31\u0e49\u0e19\u0e40\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e19\u0e35\u0e49\u0e15\u0e49\u0e2d\u0e07\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e01\u0e31\u0e19\u0e40\u0e2d\u0e07\u0e04\u0e23\u0e31\u0e1a \u0e14\u0e49\u0e27\u0e22\u0e01\u0e32\u0e23\u0e40\u0e02\u0e35\u0e22\u0e19 <a href=\"http:\/\/laravel.com\/docs\/validation\" target=\"_blank\">Validation<\/a> \u0e43\u0e2b\u0e49\u0e04\u0e23\u0e1a\u0e04\u0e23\u0e31\u0e1a<\/p>\n<p>\u0e40\u0e02\u0e35\u0e22\u0e19\u0e04\u0e23\u0e32\u0e27\u0e19\u0e35\u0e49\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e40\u0e2d\u0e32\u0e1a\u0e17\u0e04\u0e27\u0e32\u0e21\u0e40\u0e01\u0e48\u0e32\u0e21\u0e32\u0e41\u0e01\u0e49\u0e04\u0e23\u0e31\u0e1a \u0e40\u0e1e\u0e23\u0e32\u0e30\u0e0a\u0e48\u0e27\u0e07\u0e19\u0e35\u0e49\u0e07\u0e32\u0e19\u0e0a\u0e38\u0e01\u0e04\u0e23\u0e31\u0e1a\u00a0 <img src=\"http:\/\/ethaizone.me\/blog\/wp-includes\/images\/smilies\/1_002.gif\" alt=\"\/XD\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e08\u0e32\u0e01\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e01\u0e48\u0e2d\u0e19\u0e17\u0e35\u0e48\u0e40\u0e04\u0e22\u0e40\u0e02\u0e35\u0e22\u0e19 Laravel Security &hellip; <a href=\"https:\/\/ethaizone.me\/blog\/2013\/12\/laravel-4-security\/\">\u0e2d\u0e48\u0e32\u0e19\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[3,9,10],"tags":[],"class_list":["post-247","post","type-post","status-publish","format-standard","hentry","category-coding","category-laravel","category-security"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Iqnv-3Z","_links":{"self":[{"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/posts\/247"}],"collection":[{"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/comments?post=247"}],"version-history":[{"count":1,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/posts\/247\/revisions"}],"predecessor-version":[{"id":248,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/posts\/247\/revisions\/248"}],"wp:attachment":[{"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/media?parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/categories?post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ethaizone.me\/blog\/wp-json\/wp\/v2\/tags?post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}