Actions
Bug #62527
closedParameter type accepts non-integer values in shortcut redirect
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-10-29
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
Test / Replication
- Add a TYPO3 page of type shortcut
- Call the page in the frontend with the additional parameter type
- best effect can be seen if the value of the parameter is a domain
http://www.domain.tld/index.php?type=www.typo3.org
- best effect can be seen if the value of the parameter is a domain
- See the browser redirect
Cause
The responsible function is checkPageForShortcutRedirect()
located in typo3_src/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php:3152
.
- The function reads the unique id of the current page (i.e. $parameter = 1)
$parameter = $this->page['uid'];
- It reads the value of the GET-Parameter
type
(i.e. $type=www.typo3.org)$type = GeneralUtility::_GET('type');
- The value of thd parameter is concatenated with the value of the type (results in $parameter = 1,www.typo3.org)
if ($type) { $parameter .= ',' . $type; }
- TYPO3 builds a link with the given parameter (results in $redirectUrl = http://1,www.typo3.org)
$redirectUrl = $cObj->typoLink_URL(array('parameter' => $parameter));
- Finally TYPO3 redirects to the url http://1,www.typo3.org)
HttpUtility::redirect($redirectUrl, HttpUtility::HTTP_STATUS_307);
What's next
In my opinion there are two possible fixes for that:- add an
intval()
(as TSref says typeNum should be of type integer)- if, then maybe already at an earlier point
typo3/sysext/cms/tslib/index_ts.php:76
intval(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('type'))
- if, then maybe already at an earlier point
- don't concatenate parameter and type if it is not an integer
Actions