You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: guides/v2.2/coding-standards/technical-guidelines.md
+58Lines changed: 58 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -703,6 +703,64 @@ class SampleEventObserverThatModifiesInputs
703
703
{:start="14.2"}
704
704
14.2. Events used SHOULD be observed as specifically as possible. A `global` subscription to an event SHOULD NOT be used when the area impacted is just `frontend`.
705
705
706
+
## 15. Security
707
+
708
+
15.1. Use prepared statements for SQL queries.
709
+
710
+
15.2. Broken Authentication protection.
711
+
712
+
15.2.1. Where possible, implement multi-factor authentication to prevent automated, credential stuffing, brute force, and stolen credential re-use attacks.
713
+
714
+
15.2.2. Do not ship or deploy with any default credentials, particularly for admin users.
715
+
716
+
15.2.3. Implement weak-password checks, such as testing new or changed passwords against a list of the [top 10000 worst passwords](https://github.com/danielmiessler/SecLists/tree/master/Passwords).
717
+
718
+
15.2.4. Align password length, complexity, and rotation policies with [NIST 800-63 B's guidelines in section 5.1.1 for Memorized Secrets](https://pages.nist.gov/800-63-3/sp800-63b.html#memsecret) or other modern, evidence-based password policies.
719
+
720
+
15.2.5. Ensure registration, credential recovery, and API pathways are hardened against account enumeration attacks by using the same messages for all outcomes.
721
+
722
+
15.2.6. Limit or increasingly delay failed login attempts. Log all failures and alert administrators when credential stuffing, brute force, or other attacks are detected.
723
+
724
+
15.2.7. Use a server-side, secure, built-in session manager that generates a new random session ID with high entropy after login. Session IDs should not be in the URL, be securely stored and invalidated after logout, idle, and absolute timeouts.
725
+
726
+
15.3. XSS protection.
727
+
728
+
15.3.1. Sanitize input; escape output.
729
+
730
+
15.3.2. Follow [templates XSS security guidelines](https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/templates/template-security.html) for escaping output.
731
+
732
+
15.3.3. Incoming data should be casted to the expected type. String data should be validated/sanitized.
733
+
734
+
15.3.4. Incoming string data length should be checked.
735
+
736
+
15.3.5. Special characters, like null byte characters, should be dropped from Incoming string data.
737
+
738
+
15.4. A module that introduces Admin Panel functionality should have ACL.
739
+
740
+
15.5. Misconfiguration protection.
741
+
742
+
15.5.1. Do not include/require unused libraries/frameworks.
743
+
744
+
15.5.2. A segmented application architecture that provides effective, secure separation between components or tenants, with segmentation, containerization, or cloud security groups (ACLs).
745
+
746
+
15.5.3. Sending security directives to clients, e.g. [Security Headers](https://www.owasp.org/index.php/OWASP_Secure_Headers_Project).
747
+
748
+
15.6. Sensitive Data Exposure protection.
749
+
750
+
15.6.1. Exceptions/Notices/Warnings should be caught and logged.
751
+
752
+
15.6.2. No error output should be displayed to user, some standard message should appear instead.
753
+
754
+
15.6.3. Logs should not be excessive, e.g. PDO exception contains MySQL credentials that should not be logged.
755
+
756
+
15.7. CSRF protection.
757
+
758
+
15.7.1. CSRF tokens mechanism should be utilized.
759
+
760
+
15.7.2. All data manipulation requests should be made with POST requests.
761
+
762
+
15.8. Frequently update the third-party libraries used in the project/component to eliminate known vulnerabilities.
0 commit comments