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

SQL injection using length input #3141

Closed
Ahmed-Elrayes opened this issue May 5, 2024 · 5 comments
Closed

SQL injection using length input #3141

Ahmed-Elrayes opened this issue May 5, 2024 · 5 comments
Labels

Comments

@Ahmed-Elrayes
Copy link

Summary of problem or feature request

So my friends are using this package and seems like someone have been using sql injection on them
after tons of investigations and using telescope to see what's going on, seems like the length input isn't validated as numeric at all.

Code snippet of problem

image

System details

  • Operating System: Windows Server 2022
  • PHP Version: 8:0:30
  • Laravel Version: 8.0
  • Laravel-Datatables Version: 1.5
  • Laravel Datatables Oracle Version: 9.8
@yajra
Copy link
Owner

yajra commented May 6, 2024

Thanks for reporting, I think this is already fixed in versions 10 & 11 as it ensures that int is returned for length.

    public function length(): int
    {
        $length = $this->request->input('length', 10);

        return is_numeric($length) ? intval($length) : 10;
    }

Please upgrade to at least 10.x version.

@yajra
Copy link
Owner

yajra commented May 6, 2024

If you can't upgrade for some reason, feel free to submit a PR to the 9.0 branch. Thanks!

@jonjieviduya
Copy link

@yajra Is there any breaking changes when we upgrade to 10.x version? I'm currently using laravel8. And I also noticed that the website documentation is down.

@yajra
Copy link
Owner

yajra commented May 25, 2024

The docs site is fixed. I think there is not much-breaking change from 9.x to 10.x and 11.x

Copy link

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale label Jun 25, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants