Bug #92049
closedShowing Ref-Information not working
100%
Description
- Enable the [Ref] column in any record list.
- Click on the [Ref] label in a row. An error is shown: "Sie haben nicht die nötigen Rechte, um diese Änderung durchzuführen.".
The bug is because of malformed query parameters sent from JavaScript to the backend. Check the [Ref] link that triggers loading of the information-pane:
<a href="#" data-dispatch-action="TYPO3.InfoWindow.showItem" data-dispatch-args-list="'be_groups', '2'" title="" data-original-title="Referenzen anzeigen (95)">95</a>
The parameters in data-dispatch-args-list get sent as-is to the backend. The ElementInformationController receives the follwing query parameters:
table => "'be_groups'" uid => " '2'"
This implementation is implemented very questionably. There seems to be no proper validation or sanitizing of the sent data. Why not sending the data as a serialized JSON, e.g. via JSON.stringify()?
There are multiple places where this can be hot-fixed. E.g. Xclass the ElementInformationController at the init() method and sanitize the sent date manually:
protected function init(ServerRequestInterface $request): void
{
$queryParams = $request->getQueryParams();
$this->table = preg_replace('/[^\w_\-]/', '', $queryParams['table']) ?? null;
$this->uid = preg_replace('/[^\d]/', '', $queryParams['uid']) ?? null;
// [...]
}
Updated by Andreas Kienast over 4 years ago
I think this is not a JavaScript issue per se, but the markup is generated wrong in DatabaseRecordList
already:
->createShowItemTagAttributes()
->generateReferenceToolTip()
->createReferenceHtml()
The method createReferenceHtml()
uses GeneralUtility::quoteJSvalue()
which quotes the values for further usage in JavaScript, which is then used as-is.
Updated by Daniel Windloff over 4 years ago
- Related to Story #82206: list module enhancements/bugfixes added
Updated by Gerrit Code Review over 4 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65432
Updated by Gerrit Code Review over 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/65421
Updated by Daniel Windloff over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset eb82c1d83243407301b1ec040b448035f3d06e67.
Updated by Georg Ringer about 4 years ago
- Has duplicate Bug #91830: ElementInformationController gets wrong table name when clicking on the ref counter leading to access denied even for admins added