Support the ongoing development of Laravel.io →
Security Requests Input
Last updated 2 years ago.
0

I would say that it is totally safe to not sanitize your subDomain name. In the domain name you are not allowed to use characters like * or () etc. Hence, you cannot create SQL queries and so on. Other thoughts?

0

If you are not using DB::raw or other raw database functions (like whereRaw), you are safe.

But remember that "subdomain" is just another header in an HTTP request and thus can be manipulated by user. Whether a web server sanitizes it before passing to PHP, or if PHP does it itself, I'm not sure, but subdomain should be treated as any other user input.

0

Thanks Xum, thats what i am worries about because it is just, as you stated, HTTP.

However based on your first statement, Laravel sanatizes it through its PDO?

0
Solution

Yep, unless you specifically use raw DB functions, Laravel sanitizes everything.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.