What are common security vulnerabilities associated with using $_GET in PHP?

Using $_GET in PHP can lead to security vulnerabilities such as SQL injection and cross-site scripting (XSS) attacks if the input is not properly sanitized. To prevent these vulnerabilities, always validate and sanitize any data received through $_GET before using it in your application.

// Sanitize input received through $_GET
$param = isset($_GET['param']) ? htmlspecialchars($_GET['param']) : '';