@@ -327,87 +327,254 @@ CodeIgniter provisions
327327A06:2021 Vulnerable and Outdated Components
328328*******************************************
329329
330- Many applications have known vulnerabilities and known attack strategies that
331- can be exploited in order to gain remote control or to exploit data.
330+ You are likely vulnerable:
331+
332+ - If you do not know the versions of all components you use (both client-side
333+ and server-side). This includes components you directly use as well as nested
334+ dependencies.
335+ - If the software is vulnerable, unsupported, or out of date. This includes the OS,
336+ web/application server, database management system (DBMS), applications, APIs
337+ and all components, runtime environments, and libraries.
338+ - If you do not scan for vulnerabilities regularly and subscribe to security
339+ bulletins related to the components you use.
340+ - If you do not fix or upgrade the underlying platform, frameworks, and dependencies
341+ in a risk-based, timely fashion. This commonly happens in environments when
342+ patching is a monthly or quarterly task under change control, leaving organizations
343+ open to days or months of unnecessary exposure to fixed vulnerabilities.
344+ - If software developers do not test the compatibility of updated, upgraded, or
345+ patched libraries.
346+ - If you do not secure the components’ configurations (see A05:2021-Security
347+ Misconfiguration).
332348
333349OWASP recommendations
334350=====================
335351
336- - Don't use any of these
352+ There should be a patch management process in place to:
353+
354+ - Remove unused dependencies, unnecessary features, components, files, and
355+ documentation.
356+ - Continuously inventory the versions of both client-side and server-side components
357+ (e.g., frameworks, libraries) and their dependencies using tools like versions,
358+ OWASP Dependency Check, retire.js, etc. Continuously monitor sources like Common
359+ Vulnerability and Exposures (CVE) and National Vulnerability Database (NVD) for
360+ vulnerabilities in the components. Use software composition analysis tools to
361+ automate the process. Subscribe to email alerts for security vulnerabilities
362+ related to components you use.
363+ - Only obtain components from official sources over secure links. Prefer signed
364+ packages to reduce the chance of including a modified, malicious component
365+ (See A08:2021-Software and Data Integrity Failures).
366+ - Monitor for libraries and components that are unmaintained or do not create
367+ security patches for older versions. If patching is not possible, consider
368+ deploying a virtual patch to monitor, detect, or protect against the discovered
369+ issue.
370+
371+ Every organization must ensure an ongoing plan for monitoring, triaging, and
372+ applying updates or configuration changes for the lifetime of the application or
373+ portfolio.
337374
338375CodeIgniter provisions
339376======================
340377
341- - Third party libraries incorporated must be vetted
378+ - Easy :ref: ` app-starter-upgrading ` by Composer
342379
343380***************************************************
344381A07:2021 Identification and Authentication Failures
345382***************************************************
346383
347- Inadequate authentication or improper session management can lead to a user
348- getting more privileges than they are entitled to.
384+ Confirmation of the user's identity, authentication, and session management is
385+ critical to protect against authentication-related attacks. There may be
386+ authentication weaknesses if the application:
387+
388+ - Permits automated attacks such as credential stuffing, where the attacker has
389+ a list of valid usernames and passwords.
390+ - Permits brute force or other automated attacks.
391+ - Permits default, weak, or well-known passwords, such as "Password1" or "admin/admin".
392+ - Uses weak or ineffective credential recovery and forgot-password processes,
393+ such as "knowledge-based answers," which cannot be made safe.
394+ - Uses plain text, encrypted, or weakly hashed passwords data stores
395+ (see A02:2021-Cryptographic Failures).
396+ - Has missing or ineffective multi-factor authentication.
397+ - Exposes session identifier in the URL.
398+ - Reuse session identifier after successful login.
399+ - Does not correctly invalidate Session IDs. User sessions or authentication tokens
400+ (mainly single sign-on (SSO) tokens) aren't properly invalidated during logout
401+ or a period of inactivity.
349402
350403OWASP recommendations
351404=====================
352405
353- - Presentation: validate authentication & role; send CSRF token with forms
354- - Design: only use built-in session management
355- - Controller: validate user, role, CSRF token
356- - Model: validate role
357- - Tip: consider the use of a request governor
406+ - Where possible, implement multi-factor authentication to prevent automated
407+ credential stuffing, brute force, and stolen credential reuse attacks.
408+ - Do not ship or deploy with any default credentials, particularly for admin users.
409+ - Implement weak password checks, such as testing new or changed passwords against
410+ the top 10,000 worst passwords list.
411+ - Align password length, complexity, and rotation policies with National Institute
412+ of Standards and Technology (NIST) 800-63b's guidelines in section 5.1.1 for
413+ Memorized Secrets or other modern, evidence-based password policies.
414+ - Ensure registration, credential recovery, and API pathways are hardened against
415+ account enumeration attacks by using the same messages for all outcomes.
416+ - Limit or increasingly delay failed login attempts, but be careful not to create
417+ a denial of service scenario. Log all failures and alert administrators when
418+ credential stuffing, brute force, or other attacks are detected.
419+ - Use a server-side, secure, built-in session manager that generates a new random
420+ session ID with high entropy after login. Session identifier should not be in
421+ the URL, be securely stored, and invalidated after logout, idle, and absolute
422+ timeouts.
358423
359424CodeIgniter provisions
360425======================
361426
362427- :doc: `Session <../libraries/sessions >` library
363- - :doc: `Security </libraries/security >` library provides for CSRF validation
364- - An official authentication and authorization framework :ref: `CodeIgniter Shield <shield >`
365- - Easy to add third party authentication
428+ - An official authentication and authorization framework
429+ :ref: `CodeIgniter Shield <shield >`
366430
367431*********************************************
368432A08:2021 Software and Data Integrity Failures
369433*********************************************
370434
371- @TODO
435+ Software and data integrity failures relate to code and infrastructure that does
436+ not protect against integrity violations. An example of this is where an application
437+ relies upon plugins, libraries, or modules from untrusted sources, repositories,
438+ and content delivery networks (CDNs). An insecure CI/CD pipeline can introduce
439+ the potential for unauthorized access, malicious code, or system compromise.
440+
441+ Lastly, many applications now include auto-update functionality, where updates
442+ are downloaded without sufficient integrity verification and applied to the previously
443+ trusted application. Attackers could potentially upload their own updates to be
444+ distributed and run on all installations.
445+
446+ Another example is where objects or data are encoded or serialized into a structure
447+ that an attacker can see and modify is vulnerable to insecure deserialization.
372448
373449OWASP recommendations
374450=====================
375451
376- - @TODO
452+ - Use digital signatures or similar mechanisms to verify the software or data is
453+ from the expected source and has not been altered.
454+ - Ensure libraries and dependencies, such as npm or Maven, are consuming trusted
455+ repositories. If you have a higher risk profile, consider hosting an internal
456+ known-good repository that's vetted.
457+ - Ensure that a software supply chain security tool, such as OWASP Dependency
458+ Check or OWASP CycloneDX, is used to verify that components do not contain
459+ known vulnerabilities
460+ - Ensure that there is a review process for code and configuration changes to
461+ minimize the chance that malicious code or configuration could be introduced
462+ into your software pipeline.
463+ - Ensure that your CI/CD pipeline has proper segregation, configuration, and
464+ access control to ensure the integrity of the code flowing through the build
465+ and deploy processes.
466+ - Ensure that unsigned or unencrypted serialized data is not sent to untrusted
467+ clients without some form of integrity check or digital signature to detect
468+ tampering or replay of the serialized data
377469
378470CodeIgniter provisions
379471======================
380472
381- - @TODO
473+ - n/a
382474
383475*************************************************
384476A09:2021 Security Logging and Monitoring Failures
385477*************************************************
386478
387- @TODO
479+ This category is to help detect, escalate, and respond to active breaches. Without
480+ logging and monitoring, breaches cannot be detected. Insufficient logging, detection,
481+ monitoring, and active response occurs any time:
482+
483+ - Auditable events, such as logins, failed logins, and high-value transactions,
484+ are not logged.
485+ - Warnings and errors generate no, inadequate, or unclear log messages.
486+ - Logs of applications and APIs are not monitored for suspicious activity.
487+ - Logs are only stored locally.
488+ - Appropriate alerting thresholds and response escalation processes are not in
489+ place or effective.
490+ - Penetration testing and scans by dynamic application security testing (DAST)
491+ tools (such as OWASP ZAP) do not trigger alerts.
492+ - The application cannot detect, escalate, or alert for active attacks in real-time
493+ or near real-time.
494+
495+ You are vulnerable to information leakage by making logging and alerting events
496+ visible to a user or an attacker (see A01:2021-Broken Access Control).
388497
389498OWASP recommendations
390499=====================
391500
392- - @TODO
501+ Developers should implement some or all the following controls, depending on the risk of the application:
502+
503+ - Ensure all login, access control, and server-side input validation failures can
504+ be logged with sufficient user context to identify suspicious or malicious
505+ accounts and held for enough time to allow delayed forensic analysis.
506+ - Ensure that logs are generated in a format that log management solutions can
507+ easily consume.
508+ - Ensure log data is encoded correctly to prevent injections or attacks on the
509+ logging or monitoring systems.
510+ - Ensure high-value transactions have an audit trail with integrity controls to
511+ prevent tampering or deletion, such as append-only database tables or similar.
512+ - DevSecOps teams should establish effective monitoring and alerting such that
513+ suspicious activities are detected and responded to quickly.
514+ - Establish or adopt an incident response and recovery plan, such as National
515+ Institute of Standards and Technology (NIST) 800-61r2 or later.
516+
517+ There are commercial and open-source application protection frameworks such as
518+ the OWASP ModSecurity Core Rule Set, and open-source log correlation software,
519+ such as the Elasticsearch, Logstash, Kibana (ELK) stack, that feature custom
520+ dashboards and alerting.
393521
394522CodeIgniter provisions
395523======================
396524
397- - @TODO
525+ - :doc: `Logging <../general/logging >` library
526+ - An official authentication and authorization framework
527+ :ref: `CodeIgniter Shield <shield >`
398528
399529*******************************************
400530A10:2021 Server-Side Request Forgery (SSRF)
401531*******************************************
402532
403- @TODO
533+ SSRF flaws occur whenever a web application is fetching a remote resource without
534+ validating the user-supplied URL. It allows an attacker to coerce the application
535+ to send a crafted request to an unexpected destination, even when protected by a
536+ firewall, VPN, or another type of network access control list (ACL).
537+
538+ As modern web applications provide end-users with convenient features, fetching
539+ a URL becomes a common scenario. As a result, the incidence of SSRF is increasing.
540+ Also, the severity of SSRF is becoming higher due to cloud services and the
541+ complexity of architectures.
404542
405543OWASP recommendations
406544=====================
407545
408- - @TODO
546+ Developers can prevent SSRF by implementing some or all the following defense in
547+ depth controls:
548+
549+ From Network layer:
550+
551+ - Segment remote resource access functionality in separate networks to reduce the
552+ impact of SSRF
553+ - Enforce “deny by default” firewall policies or network access control rules to
554+ block all but essential intranet traffic.
555+
556+ - Hints:
557+
558+ * Establish an ownership and a lifecycle for firewall rules based on
559+ applications.
560+ * Log all accepted and blocked network flows on firewalls
561+ (see A09:2021-Security Logging and Monitoring Failures).
562+
563+ From Application layer:
564+
565+ - Sanitize and validate all client-supplied input data
566+ - Enforce the URL schema, port, and destination with a positive allow list
567+ - Do not send raw responses to clients
568+ - Disable HTTP redirections
569+ - Be aware of the URL consistency to avoid attacks such as DNS rebinding and
570+ “time of check, time of use” (TOCTOU) race conditions
571+
572+ Do not mitigate SSRF via the use of a deny list or regular expression. Attackers
573+ have payload lists, tools, and skills to bypass deny lists.
409574
410575CodeIgniter provisions
411576======================
412577
413- - @TODO
578+ - :doc: `../libraries/validation ` library
579+ - :doc: `HTTP library <../incoming/incomingrequest >` provides for
580+ :ref: `input field filtering <incomingrequest-filtering-input-data >`
0 commit comments