#27099 closed defect (bug) (invalid)
Input validation on wp-includes/ms-blogs.php in line 52
| Reported by: | OswaldoMG | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 3.9 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description (last modified by )
Improper neutralization of directives in dynamically evaluated code.
Those lines of code allow user-controlled input to be fed directly into a function (e. g. "eval") that dynamically evaluates and executes the input as code, usually in the same interpreted language that the product uses.
Found by static analysis application.
function get_blogaddress_by_name( $blogname ) {
if ( is_subdomain_install() ) {
if ( $blogname == 'main' )
$blogname = 'www';
$url = rtrim( network_home_url(), '/' );
if ( !empty( $blogname ) )
$url = preg_replace( '|^([^\.]+://)|', "\${1}" . $blogname . '.', $url );
} else {
$url = network_home_url( $blogname );
}
return esc_url( $url . '/' );
}
Recommendations: Do not allow untrusted input to be evaluated or otherwise interpreted as code.
Change History (3)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
If you're going to submit any more static code analysis tickets, please read the ticket form first:
This is invalid. This is a backreference, not a variable.