{"id":70005,"date":"2021-08-23T04:10:06","date_gmt":"2021-08-23T08:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/php-security-coding-that-maintains-security-16\/"},"modified":"2021-08-23T04:10:06","modified_gmt":"2021-08-23T08:10:06","slug":"php-security-coding-that-maintains-security-16","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=70005","title":{"rendered":"PHP Security: Coding that Maintains Security #16"},"content":{"rendered":"<h2>Php Security<\/h2>\n<p>PHP can be included as a module to the web-server, or executed as a separate executable binary. In either case, it can access files, execute commands, open network connections in the server. Further, PHP can be used to write scripts with all the power of the shell users. Hence, anything running on that server may face security problems. Though, careful coding will reduce the risks to a great extent[php.net].<\/p>\n<h2>Common security risks in PHP[Abdul Basit, php.net]<\/h2>\n<p>Most common are :<\/p>\n<ul>\n<li>1-Invalidated Input Errors<\/li>\n<li>2-Access Control Flaws<\/li>\n<li>3-Session ID Protection<\/li>\n<li>4-Cross Site Scripting (XSS) Attacks<\/li>\n<li>5-SQL Injection Vulnerabilities<\/li>\n<li>6-Error Reporting<\/li>\n<li>7-Data Handling Errors<\/li>\n<li>8-PHP configuration settings<\/li>\n<\/ul>\n<h2>PHP Security when installed as a CGI Binary[php.net]<\/h2>\n<ul>\n<li> Do not place any interpreters into the cgi-bin directory<\/li>\n<li> Even If PHP is installed as a standalone binary (and in cgi-bin directory), PHP can prevent attacks that may arise from such setting.<\/li>\n<li>Accessing system files: http:\/\/my.host\/cgi-bin\/php?\/etc\/passwd &#8212; using such URLs can be risky, the part after ? may be treated as command line arguments to the interpreter, and hence, in some cases pose risks<\/li>\n<li>Accessing any web document on server: http:\/\/my.host\/cgi-bin\/php\/secret\/doc.html &#8212; this way can also be risky <\/li>\n<\/ul>\n<p>PHP compile time options such as &#8211;enable-force-cgi-redirect and runtime configuration directives doc_root and user_dir can be used to prevent such risks.<\/p>\n<p>From: http:\/\/sitestree.com\/?p=4742<br \/> Categories:16<br \/>Tags:<br \/> Post Data:2008-07-09 01:21:35<\/p>\n<pre><code>    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\"&gt;https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    (Big Data, Cloud, Security, Machine Learning): Courses: &lt;a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"&gt; http:\/\/Training.SitesTree.com&lt;\/a&gt; \n    In Bengali: &lt;a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\"&gt;http:\/\/Bangla.SaLearningSchool.com&lt;\/a&gt;\n    &lt;a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\"&gt;http:\/\/SitesTree.com&lt;\/a&gt;\n    8112223 Canada Inc.\/JustEtc: &lt;a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\"&gt;http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) &lt;\/a&gt;\n    Shop Online: &lt;a href='https:\/\/www.ShopForSoul.com'&gt; https:\/\/www.ShopForSoul.com\/&lt;\/a&gt;\n    Medium: &lt;a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"&gt; https:\/\/medium.com\/@SayedAhmedCanada &lt;\/a&gt;\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Php Security PHP can be included as a module to the web-server, or executed as a separate executable binary. In either case, it can access files, execute commands, open network connections in the server. Further, PHP can be used to write scripts with all the power of the shell users. Hence, anything running on that &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=70005\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-70005","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":23303,"url":"http:\/\/bangla.sitestree.com\/?p=23303","url_meta":{"origin":70005,"position":0},"title":"PHP Interview Questions #Root #By Sayed Ahmed","author":"Author-Check- Article-or-Video","date":"March 29, 2021","format":false,"excerpt":"http:\/\/www.fluffycat.com\/PHP-Design-Patterns\/PHP-Job-Interview-Questions\/ http:\/\/php.net\/manual\/en\/language.oop5.object-comparison.php http:\/\/www.programmerinterview.com\/index.php\/design-pattern-questions\/design-pattern-interview-questions-and-answers\/ https:\/\/www.glassdoor.co.in\/Interview\/canada-software-developer-interview-questions-SRCH_IL.0,6_IN3_KO7,25.htm From: http:\/\/sitestree.com\/?p=3923 Categories:Root, By Sayed AhmedTags: Post Data:2016-09-15 14:17:36 Shop Online: https:\/\/www.ShopForSoul.com\/ (Big Data, Cloud, Security, Machine Learning): Courses: http:\/\/Training.SitesTree.com In Bengali: http:\/\/Bangla.SaLearningSchool.com http:\/\/SitesTree.com 8112223 Canada Inc.\/JustEtc: http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) Shop Online: https:\/\/www.ShopForSoul.com\/ Medium: https:\/\/medium.com\/@SayedAhmedCanada","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":22529,"url":"http:\/\/bangla.sitestree.com\/?p=22529","url_meta":{"origin":70005,"position":1},"title":"Resources Checked Recently on PHP, OOP, OOD, Java, Angular, Bootstrap, Design Patterns #Root #By Sayed Ahmed #Misc. Reading","author":"Author-Check- Article-or-Video","date":"March 15, 2021","format":false,"excerpt":"Resources Checked Recently on PHP, OOP, OOD, Java, Angular, Bootstrap, Design Patterns http:\/\/www.fluffycat.com\/PHP-Design-Patterns\/PHP-Job-Interview-Questions\/ http:\/\/php.net\/manual\/en\/language.oop5.object-comparison.php http:\/\/www.programmerinterview.com\/index.php\/design-pattern-questions\/design-pattern-interview-questions-and-answers\/ https:\/\/www.glassdoor.co.in\/Interview\/canada-software-developer-interview-questions-SRCH_IL.0,6_IN3_KO7,25.htm http:\/\/www.tutorialspoint.com\/design_pattern\/decorator_pattern.htm http:\/\/www.fluffycat.com\/PHP-Design-Patterns\/ http:\/\/programmers.stackexchange.com\/questions\/7055\/what-is-the-most-frequently-used-design-pattern http:\/\/salearningschool.com\/displayArticle.php?table=Articles&articleID=893 http:\/\/salearningschool.com\/displayArticle.php?table=Articles&articleID=987 Abstract Factory: https:\/\/sourcemaking.com\/design_patterns\/abstract_factory\/php\/2 Decorator Pattern: http:\/\/www.tutorialspoint.com\/design_pattern\/decorator_pattern.htm Singleton: http:\/\/stackoverflow.com\/questions\/8776788\/best-practice-on-php-singleton-classes http:\/\/stackoverflow.com\/questions\/203336\/creating-the-singleton-design-pattern-in-php5\/203359#203359 https:\/\/ttmm.io\/tech\/making-singletons-safe-in-php\/ Java http:\/\/salearningschool.com\/displayArticle.php?table=Articles&articleID=858 http:\/\/stackoverflow.com\/questions\/9948008\/what-is-sapi-and-when-would-you-use-it Cookie - securing Cookie http:\/\/blog.teamtreehouse.com\/how-to-create-totally-secure-cookies http:\/\/salearningschool.com\/displayArticle.php?table=Articles&articleID=1357&title=PHP%20Security%20-%20Guidelines https:\/\/www.quora.com\/What-is-the-difference-between-htmlentities-and-htmlspecialchars-in-PHP http:\/\/stackoverflow.com\/questions\/46483\/htmlentities-vs-htmlspecialchars Prevent CSRF in PHP http:\/\/stackoverflow.com\/questions\/1780687\/preventing-csrf-in-php PHP Security Package:\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70159,"url":"http:\/\/bangla.sitestree.com\/?p=70159","url_meta":{"origin":70005,"position":2},"title":"Some recent stuff #124","author":"Author-Check- Article-or-Video","date":"August 28, 2021","format":false,"excerpt":"Reviewed C++ from http:\/\/gd.tuwien.ac.at\/languages\/c\/c++oop-pmueller\/tutorial.html. Working with a research project in electromagnetics and dealing with a tricky issue with multiple header files, typedef on templates, templates, pointers, and similar - could solve finally. C++ had to solve error like: uninitialized reference member `Edge::v1' - subclass base class constructor reference related issue\u2026","rel":"","context":"In &quot;C# - Misc&quot;","block_context":{"text":"C# - Misc","link":"http:\/\/bangla.sitestree.com\/?cat=1973"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5987,"url":"http:\/\/bangla.sitestree.com\/?p=5987","url_meta":{"origin":70005,"position":3},"title":"\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf \u09eb \u0987\u09a8\u09cd\u09b8\u099f\u09b2\u09c7\u09b6\u09a8 (PHP 5 Installation)","author":"Author-Check- Article-or-Video","date":"March 21, 2015","format":false,"excerpt":"PHP 5 \u0987\u09a8\u09b8\u09cd\u099f\u09b2\u09c7\u09b6\u09a8 \u09aa\u09cd\u09b0\u09a4\u09be\u09aa \u099a\u09a8\u09cd\u09a6\u09cd\u09b0 \u00a0 PHP \u09b6\u09bf\u0996\u09a4\u09c7 \u0997\u09c7\u09b2\u09c7 \u0986\u09aa\u09a8\u09be\u09b0 \u09a8\u09bf\u099c\u09c7\u09b0 \u09aa\u09bf\u09b8\u09bf\u09a4\u09c7 \u0995\u09bf\u0982\u09ac\u09be \u0993\u09df\u09c7\u09ac \u09b8\u09be\u09b0\u09cd\u09ad\u09be\u09b0\u09c7 \u098f\u0987 \u09b8\u09ab\u099f\u0993\u09df\u09cd\u09af\u09be\u09b0\u099f\u09bf \u09aa\u09cd\u09b0\u09df\u09cb\u099c\u09a8\u0964 \u09a4\u09be\u0987 \u0987\u09a8\u09b8\u09cd\u099f\u09b2\u09c7\u09b6\u09a8\u099f\u09be \u0986\u0997\u09c7 \u09b6\u09bf\u0996\u09a4\u09c7 \u09b9\u09ac\u09c7\u0964 PHP \u0987\u09a8\u09b8\u09cd\u099f\u09b2 \u0995\u09b0\u09a4\u09c7 \u0986\u09ae\u09b0\u09be \u09af\u09c7\u09b8\u09ac \u09ac\u09cd\u09af\u09ac\u09b8\u09cd\u09a5\u09be \u09a8\u09bf\u09a4\u09c7 \u09aa\u09be\u09b0\u09bf: PHP \u098f\u09ac\u0982 MySQL \u09b8\u09be\u09aa\u09cb\u09b0\u09cd\u099f \u0995\u09b0\u09c7 \u098f\u09ae\u09a8 \u098f\u0995\u099f\u09bf \u0993\u09df\u09c7\u09ac \u09b9\u09cb\u09b8\u09cd\u099f\u09bf\u0982 \u0996\u09c1\u099c\u09c7 \u09ac\u09c7\u09b0 \u0995\u09b0\u09be\u0964 \u0995\u09bf\u0982\u09ac\u09be, \u0986\u09aa\u09a8\u09be\u09b0 \u09a8\u09bf\u099c\u09c7\u09b0 \u0995\u09ae\u09cd\u09aa\u09bf\u0989\u099f\u09be\u09b0\u09c7 \u0993\u09df\u09c7\u09ac \u09b8\u09be\u09b0\u09cd\u09ad\u09be\u09b0 \u0987\u09a8\u09b8\u09cd\u099f\u09b2\u2026","rel":"","context":"In &quot;\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 \u0964 PHP tutorial&quot;","block_context":{"text":"\u09aa\u09bf \u098f\u0987\u099a \u09aa\u09bf \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2 \u0964 PHP tutorial","link":"http:\/\/bangla.sitestree.com\/?cat=172"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16393,"url":"http:\/\/bangla.sitestree.com\/?p=16393","url_meta":{"origin":70005,"position":4},"title":"If you want to learn security, or if you already are a security professional\/engineer, can you answer the following questions on Security? Do you know the answers to the following questions on Security?","author":"Sayed","date":"November 16, 2019","format":false,"excerpt":"Defensive Security If you want to learn security, or if you already are a security professional\/engineer, can you answer the following questions on Security? Do you know the answers to the following questions on Security? True or false, all email servers in the Internet are configured properly? What can you\u2026","rel":"","context":"In &quot;\u09ac\u09cd\u09b2\u0997 \u0964 Blog&quot;","block_context":{"text":"\u09ac\u09cd\u09b2\u0997 \u0964 Blog","link":"http:\/\/bangla.sitestree.com\/?cat=182"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26254,"url":"http:\/\/bangla.sitestree.com\/?p=26254","url_meta":{"origin":70005,"position":5},"title":"If you want to learn security, or if you already are a security professional\/engineer, can you answer the following questions on Security? Do you know the answers to the following questions on Security? #Root","author":"Author-Check- Article-or-Video","date":"April 21, 2021","format":false,"excerpt":"Defensive Security If you want to learn security, or if you already are a security professional\/engineer, can you answer the following questions on Security? Do you know the answers to the following questions on Security? True or false, all email servers in the Internet are configured properly? What can you\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=70005"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/70005\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=70005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=70005"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=70005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}