Project: Github szepeviktor/wordpress-fail2ban 20190130

Vulnerability: #9250243 (2019-01-30 20:53:44)

Warning

There are many false positives, or unexploitable vulnerabilities. Please create working "PoC" exploit before reporting anything to vendor!

Details:

Sink Standard::setcookie
Risk _POST
/wordpress-fail2ban-master/mu-plugin/wp-fail2ban-mu-instant.php:272 (show/hide source)
252          }
253  
254      }
255  
256      private function ban() {
257  
258          header( 'Status: 403 Forbidden' );
259          header( 'HTTP/1.1 403 Forbidden', true, 403 );
260          header( 'Connection: Close' );
261          header( 'Cache-Control: max-age=0, private, no-store, no-cache, must-revalidate' );
262          header( 'X-Robots-Tag: noindex, nofollow' );
263          header( 'Content-Type: text/html' );
264          header( 'Content-Length: 0' );
265      }
266  
267      private function fake_wplogin() {
268  
269          $server_name         = isset( $_SERVER['SERVER_NAME'] )
270              ? $_SERVER['SERVER_NAME']
271              : $_SERVER['HTTP_HOST'];
272 $username = trim( $_POST['log'] );
273 $expire = time() + 3600; 274 $token = substr( hash_hmac( 'sha256', (string) rand(), 'token' ), 0, 43 );
Threat level 1

Callstack:

O1\WP_Fail2ban::fake_wplogin /wordpress-fail2ban-master/mu-plugin/wp-fail2ban-mu-instant.php:282 (show/hide source)
262          header( 'X-Robots-Tag: noindex, nofollow' );
263          header( 'Content-Type: text/html' );
264          header( 'Content-Length: 0' );
265      }
266  
267      private function fake_wplogin() {
268  
269          $server_name         = isset( $_SERVER['SERVER_NAME'] )
270              ? $_SERVER['SERVER_NAME']
271              : $_SERVER['HTTP_HOST'];
272          $username            = trim( $_POST['log'] );
273          $expire              = time() + 3600;
274          $token               = substr( hash_hmac( 'sha256', (string) rand(), 'token' ), 0, 43 );
275          $hash                = hash_hmac( 'sha256', (string) rand(), 'hash' );
276          $auth_cookie         = $username . '|' . $expire . '|' . $token . '|' . $hash;
277          $authcookie_name     = 'wordpress_' . md5( 'authcookie' );
278          $loggedincookie_name = 'wordpress_logged_in_' . md5( 'cookiehash' );
279  
280          header( 'Cache-Control: max-age=0, private, no-store, no-cache, must-revalidate' );
281          header( 'X-Robots-Tag: noindex, nofollow' );
282 setcookie( $authcookie_name, $auth_cookie, $expire, '/brake/wp_content/plugins', '', false, true );
283 setcookie( $authcookie_name, $auth_cookie, $expire, '/brake/wp-admin', '', false, true ); 284 setcookie( $loggedincookie_name, $auth_cookie, $expire, '/', '', false, true );