Skip to content

Possible XSS in Paginator Helper (limitControl() method) #19172

@phpcss-ankue

Description

@phpcss-ankue

Description

During a recent pentest on one of our CakePHP apps we found that using the limit control creates unescaped hidden controls in the limit form. Neither the keys nor the values of existing query params are escaped. When using a query string such as '?limit=100&g2znn"><script>alert(1)<%2fscript>g0yjd=1%20HTTP/1.1' JavaScript may be injected into the limit control form. I think it would be beneficial to at least offer an escape parameter/option for this method or rather the possibility to determine the exact query params (escaped) to be included in the limit control form. Also, casting the limit query param value as int would be beneficial in limitControl() method to prevent XSS injections.

CakePHP Version

5.2.10

PHP Version

8.4.16

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions