Issues (2010)

Security Analysis    not enabled

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

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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.

wp-includes/feed-rss2-comments.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * RSS2 Feed Template for displaying RSS2 Comments feed.
4
 *
5
 * @package WordPress
6
 */
7
8
header('Content-Type: ' . feed_content_type('rss2') . '; charset=' . get_option('blog_charset'), true);
9
10
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
11
12
/** This action is documented in wp-includes/feed-rss2.php */
13
do_action( 'rss_tag_pre', 'rss2-comments' );
14
?>
15
<rss version="2.0"
16
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
17
	xmlns:dc="http://purl.org/dc/elements/1.1/"
18
	xmlns:atom="http://www.w3.org/2005/Atom"
19
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
20
	<?php
21
	/** This action is documented in wp-includes/feed-rss2.php */
22
	do_action( 'rss2_ns' );
23
	?>
24
25
	<?php
26
	/**
27
	 * Fires at the end of the RSS root to add namespaces.
28
	 *
29
	 * @since 2.8.0
30
	 */
31
	do_action( 'rss2_comments_ns' );
32
	?>
33
>
34
<channel>
35
	<title><?php
36 View Code Duplication
		if ( is_singular() )
37
			printf( ent2ncr( __( 'Comments on: %s' ) ), get_the_title_rss() );
38
		elseif ( is_search() )
39
			printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() );
40
		else
41
			printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() );
42
	?></title>
43
	<atom:link href="<?php self_link(); ?>" rel="self" type="application/rss+xml" />
44
	<link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link>
45
	<description><?php bloginfo_rss("description") ?></description>
46
	<lastBuildDate><?php echo mysql2date('r', get_lastcommentmodified('GMT')); ?></lastBuildDate>
47
	<sy:updatePeriod><?php
48
		/** This filter is documented in wp-includes/feed-rss2.php */
49
		echo apply_filters( 'rss_update_period', 'hourly' );
50
	?></sy:updatePeriod>
51
	<sy:updateFrequency><?php
52
		/** This filter is documented in wp-includes/feed-rss2.php */
53
		echo apply_filters( 'rss_update_frequency', '1' );
54
	?></sy:updateFrequency>
55
	<?php
56
	/**
57
	 * Fires at the end of the RSS2 comment feed header.
58
	 *
59
	 * @since 2.3.0
60
	 */
61
	do_action( 'commentsrss2_head' );
62
63
	if ( have_comments() ) : while ( have_comments() ) : the_comment();
64
		$comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
65
	?>
66
	<item>
67
		<title><?php
68 View Code Duplication
			if ( !is_singular() ) {
69
				$title = get_the_title($comment_post->ID);
70
				/** This filter is documented in wp-includes/feed.php */
71
				$title = apply_filters( 'the_title_rss', $title );
72
				printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss());
73
			} else {
74
				printf(ent2ncr(__('By: %s')), get_comment_author_rss());
75
			}
76
		?></title>
77
		<link><?php comment_link() ?></link>
78
		<dc:creator><![CDATA[<?php echo get_comment_author_rss() ?>]]></dc:creator>
79
		<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true, false), false); ?></pubDate>
80
		<guid isPermaLink="false"><?php comment_guid() ?></guid>
81
<?php if ( post_password_required($comment_post) ) : ?>
0 ignored issues
show
It seems like $comment_post defined by $GLOBALS['post'] = get_p...mment->comment_post_ID) on line 64 can also be of type array; however, post_password_required() does only seem to accept integer|object<WP_Post>|null, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
82
		<description><?php echo ent2ncr(__('Protected Comments: Please enter your password to view comments.')); ?></description>
83
		<content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>
84
<?php else : // post pass ?>
85
		<description><![CDATA[<?php comment_text_rss() ?>]]></description>
86
		<content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded>
87
<?php endif; // post pass
88
	/**
89
	 * Fires at the end of each RSS2 comment feed item.
90
	 *
91
	 * @since 2.1.0
92
	 *
93
	 * @param int $comment->comment_ID The ID of the comment being displayed.
94
	 * @param int $comment_post->ID    The ID of the post the comment is connected to.
95
	 */
96
	do_action( 'commentrss2_item', $comment->comment_ID, $comment_post->ID );
97
?>
98
	</item>
99
<?php endwhile; endif; ?>
100
</channel>
101
</rss>
102