Issues (461)

Branch: master

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  Header Injection
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

comments.php (4 issues)

1
<?php
2
/**
3
 * The template for displaying Comments.
4
 *
5
 * @package lsx
6
 */
7
8
if ( post_password_required() ) {
9
	return;
10
}
11
12
$commenter = wp_get_current_commenter();
13
$req       = get_option( 'require_name_email' );
14
$aria_req  = ( $req ? " aria-required='true'" : '' );
15
$html_req  = ( $req ? " required='required'" : '' );
16
17
$comment_form_args = array(
18
	'comment_field' => '<p class="comment-form-comment"><textarea placeholder="' . esc_html__( 'Comment', 'lsx' ) . '" id="comment" class="form-control" name="comment" cols="45" rows="8"' . $aria_req . $html_req . '></textarea></p>',
19
20
	'fields'        => array(
21
		'author' => '<p class="comment-form-author"><label for="author">' . esc_html__( 'Name', 'lsx' ) . '</label> ' .
22
			( $req ? '<span class="required">*</span>' : '' ) .
23
			'<input class="form-control" placeholder="' . esc_html__( 'Name', 'lsx' ) . '" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . $html_req . '></p>',
24
25
		'email'  => '<p class="comment-form-email"><label for="email">' . esc_html__( 'Email', 'lsx' ) . '</label> ' .
26
			( $req ? '<span class="required">*</span>' : '' ) .
27
			'<input class="form-control" placeholder="' . esc_html__( 'Email', 'lsx' ) . '" id="email" name="email" type="text" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . $html_req . '></p>',
28
29
		'url'    => '<p class="comment-form-url"><label for="url">' . esc_html__( 'Website', 'lsx' ) . '</label>' .
30
			'<input class="form-control" placeholder="' . esc_html__( 'Website', 'lsx' ) . '" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30"></p>',
31
	),
32
);
33
34
comment_form( $comment_form_args );
35
36
if ( have_comments() ) : ?>
37
38
	<?php lsx_comments_before(); ?>
39
40
	<section id="comments">
41
		<h3>
42
			<?php
43
				$comments_number = get_comments_number();
44
45
			if ( '1' === $comments_number ) {
46
				printf(
47
					/* Translators: %s: post title */
48
					esc_html_x( 'One Response to &ldquo;%s&rdquo;', 'comments.php', 'lsx' ),
49
					get_the_title()
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'get_the_title'.
Loading history...
50
				);
51
			} else {
52
				printf(
53
					esc_html(
54
						/* Translators: 1: number of comments, 2: post title */
55
						_nx(
56
							'%1$s Response to &ldquo;%2$s&rdquo;',
57
							'%1$s Responses to &ldquo;%2$s&rdquo;',
58
							$comments_number,
0 ignored issues
show
It seems like $comments_number can also be of type string; however, parameter $number of _nx() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

58
							/** @scrutinizer ignore-type */ $comments_number,
Loading history...
59
							'comments.php',
60
							'lsx'
61
						)
62
					),
63
					esc_html( number_format_i18n( $comments_number ) ),
0 ignored issues
show
It seems like $comments_number can also be of type string; however, parameter $number of number_format_i18n() does only seem to accept double, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

63
					esc_html( number_format_i18n( /** @scrutinizer ignore-type */ $comments_number ) ),
Loading history...
64
					get_the_title()
0 ignored issues
show
All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found 'get_the_title'.
Loading history...
65
				);
66
			}
67
			?>
68
		</h3>
69
70
		<ol class="media-list">
71
			<?php
72
				wp_list_comments(
73
					array(
74
						'walker' => new LSX_Walker_Comment(),
75
					)
76
				);
77
			?>
78
		</ol>
79
80
		<?php
81
		$comment_pages_count = get_comment_pages_count();
82
		if ( $comment_pages_count > 1 && get_option( 'page_comments' ) ) :
83
			?>
84
			<nav>
85
				<ul class="pager">
86
					<?php if ( get_previous_comments_link() ) : ?>
87
						<li class="previous"><?php previous_comments_link( esc_html__( '&larr; Older comments', 'lsx' ) ); ?></li>
88
					<?php endif; ?>
89
90
					<?php if ( get_next_comments_link() ) : ?>
91
						<li class="next"><?php next_comments_link( esc_html__( 'Newer comments &rarr;', 'lsx' ) ); ?></li>
92
					<?php endif; ?>
93
				</ul>
94
			</nav>
95
		<?php endif; ?>
96
97
		<?php if ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
98
			<div class="alert alert-warning">
99
				<?php esc_html_e( 'Comments are closed.', 'lsx' ); ?>
100
			</div>
101
		<?php endif; ?>
102
	</section><!-- /#comments -->
103
104
	<?php lsx_comments_after(); ?>
105
106
<?php endif; ?>
107
108
<?php if ( ! have_comments() && ! comments_open() && post_type_supports( get_post_type(), 'comments' ) ) : ?>
109
110
	<section id="comments">
111
		<div class="alert alert-warning">
112
			<?php esc_html_e( 'Comments are closed.', 'lsx' ); ?>
113
		</div>
114
	</section><!-- /#comments -->
115
116
	<?php lsx_comments_after(); ?>
117
118
	<?php
119
	endif;
120
?>
121