Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Column mixed up when using JSON_ARRAYAGG #5799

Open
kobyan opened this issue Nov 6, 2024 · 0 comments
Open

Column mixed up when using JSON_ARRAYAGG #5799

kobyan opened this issue Nov 6, 2024 · 0 comments

Comments

@kobyan
Copy link

kobyan commented Nov 6, 2024

I encountered a situation where some of the column values ​​in my output csv file were defined in other columns. That is, I ran with columns -C id,login,pass,data, and in the output file for some of the lines the result was id,login,data,pass, and for some - id,login,pass,data.
The reason for this is that in UNION based injections using JSON_ARRAYAGG, the column values ​​are connected via CONCAT_WS. But if one of the column values ​​is NULL, CONCAT_WS simply skips it and does not add a separator string after it. Therefore, the column values ​​are mixed up in the resulting csv file. When dumping a large number of columns, this can create complete chaos in the result.

To solve this problem, it makes sense to do processing for the columns via IFNULL. (IFNULL(<column>, 0x20))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant