Details

    • Type: Language-Specification
    • Status: Active
    • Resolution: Unresolved
    • Labels:
      None
    • Impact:
      Unknown 'null' severity
    • Likelihood:
      Unknown 'null' severity

      Description

      Recommended Secure Coding Practices

      The application should run by default in the most secure mode, i.e. as on production servers. This is to prevent any mistake. Enabling debug mode should be explicitly asked via a command line argument, an environment variable or a configuration file.

      Check that every aspect of the debug mode is controlled by only one configuration switch: logging, exception/error handling, access control, etc... It is otherwise very easy to forget one of them.

      Do not enable debug mode on production servers.

      Only the value "0" or "false" for CakePHP 3.x is suitable (production mode) to not leak sensitive data on the logs.

      Noncompliant Code Example

      CakePHP 1.x, 2.x:

      Configure::write('debug', 1); // Noncompliant; development mode
      or
      Configure::write('debug', 2); // Noncompliant; development mode
      or
      Configure::write('debug', 3); // Noncompliant; development mode
      

      CakePHP 3.0:

      use Cake\Core\Configure;
      
      Configure::config('debug', true);
      

      Compliant Solution

      CakePHP 1.2:

      Configure::write('debug', 0); // Compliant; this is the production mode 
      

      CakePHP 3.0:

      use Cake\Core\Configure;
      
      Configure::config('debug', false);
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alexandre.gigleux Alexandre Gigleux
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: