Bug #62527
closedParameter type accepts non-integer values in shortcut redirect
100%
Description
- 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
Updated by Helmut Hummel about 10 years ago
- Status changed from New to Needs Feedback
You're correctly describing current behavior.
But what is the actually the problem you are running into with this behavior (besides argument values being passed to TYPO3 are used as is)?
Updated by Sascha Egerer about 10 years ago
Isn't this some kind of CSRF?
If you open a domain like www.my-typo3.com?type=www.an-eval-page.com
you will be redirected to http://1,www.an-eval-page.com
. Not sure if there is any attack vektor.
Updated by Helmut Hummel about 10 years ago
- Project changed from TYPO3 Core to 1716
Updated by Helmut Hummel about 10 years ago
- Project changed from 1716 to TYPO3 Core
- Status changed from Needs Feedback to Accepted
- Is Regression set to No
Ok. Now I understand the issue.
Simply calling a TYPO3 shortcut page (>= TYPO3 4.6) with a type parameter value that contains a dot "." redirects to a URL
http://<uidOfShortcutPage>,<valueGivenForType>
e.g.:
http://example.tld?id=1&type=.
Redirects to
http://1,.
This is not nice and should probably be fixed with an intval, but I can't imagine a way to exploit it, thus moving this back to the normal core tracker
Updated by Markus Klein about 10 years ago
Yet another instance where we have insufficient type checking.
Updated by Gerrit Code Review about 10 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34193
Updated by Gerrit Code Review almost 10 years ago
Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34193
Updated by Gerrit Code Review almost 10 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35037
Updated by Gerrit Code Review almost 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35037
Updated by Gerrit Code Review almost 10 years ago
Patch set 3 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34193
Updated by Gerrit Code Review almost 10 years ago
Patch set 4 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34193
Updated by Björn Fromme almost 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 180e9d505b485eb8b833e5608986c63473c46db0.