Saltar al contenido principal
Soporte
0
Contacta con nosotros
English
Nederlands
Deutsch
Servidores dedicadosFlexible VPSTecnología de nubeUbicación compartidaDesafíos en TISectoresCareers
Cloud Compute

Con Cloud Compute, tendrás acceso a un portal desde el que podrás configurar todo tu entorno informático en cualquier momento y desde cualquier lugar del mundo.

Almacenamiento en la nube

Acceso fiable a tus archivos, infraestructura y aplicaciones en todo momento, sin interrupciones ni retrasos. En Worldstream, ofrecemos una gran variedad de soluciones de almacenamiento.

Flexible cloud icon
Nube flexible
Private cloud icon
Nube privada
Bare metal icon
Bare Metal Compute
Hollow cube icon
Almacenamiento de objetos
Hollow cube icon
Almacenamiento de archivos
Block storage icon
Almacenamiento en bloque
Backup storage icon
Almacenamiento de copias de seguridad
¿Necesitas soporte?

Con ingenieros experimentados y un tiempo medio de respuesta de 7 minutos, puedes esperar una solución de soporte técnico sólida muy rápida.

Soporte
Todos los servidores

Elige tu servidor dedicado ahora. Configuración personalizada o entrega inmediata. Servidores potentes diseñados para tu caso de uso.

Casos de uso

Sea cual sea tu caso de uso, te ayudamos a encontrar la solución adecuada.

Deal servers icon
Ofertas
AMD servers icon
Servidores AMD
AI servers icon
Servidores Intel
Hollow cube icon
Virtualización, Contenerización y Orquestación
Hollow cube icon
Sitios web y aplicaciones
Hollow cube icon
Infraestructura para gaming y streaming

Soporte 24/7/365 con un tiempo medio de respuesta de solo 7 minutos. Gracias a nuestros propios centros de datos, nuestros ingenieros pueden acceder directamente a tu servidor para ofrecer soporte rápido y directo. Contáctanos por correo o teléfono en cualquier momento.

Soporte
Externalización inteligente

Algunos aspectos de la TI crean valor añadido, mientras que otros sirven de apoyo. Aprovéchalo como punto de partida para la externalización.

Rentabilidad

Los paquetes informáticos completos pueden parecer la opción segura, pero al considerar los costes, otras opciones suelen tener más sentido.

Flexibilidad y control informáticos

Externalizar no implica perder el control; en realidad proporciona más flexibilidad y control.

Repatriación desde la nube

La nube no es el destino final: debes evaluar y ajustar tu entorno de nube continuamente a medida que cambian las necesidades.

Servicios financieros
Logística y transporte
Venta minorista y comercio electrónico
Medios de comunicación y entretenimiento
Tecnología y desarrollo de software
Seguridad
Proveedores de servicios gestionados
¿Necesitas soporte?

Con ingenieros experimentados y un tiempo medio de respuesta de 7 minutos, puedes esperar una solución de soporte técnico sólida muy rápida.

Habla con nosotrosContacta con nosotros
Acerca de WorldstreamAcerca de la tecnologíaCasosBase de conocimientos
Quiénes somosConoce al equipoTrabaja con nosotrosHazte distribuidorcertificacionesNuestros centros de datosNuestra redProtección DDoSServidores AMD EPYCPartners tecnológicosAcerca de los servidores dedicadosTodos los casosEasyTerraDutch Drone CompanyPerfGridArtículosPreguntas frecuentesNoticias y blogsProductos y servicios
Contacta con nosotros

Llama al +31 (0) 174 – 712 117 Industriestraat 53, Naaldwijk

Contacta con nosotros
Worldstream Portal
English
Nederlands
Deutsch
0
Servidores dedicadosFlexible VPSTecnología de nubeUbicación compartidaDesafíos en TISectoresCareersAcerca de WorldstreamAcerca de la tecnologíaCasosBase de conocimientosMy Worldstream
Contact
Soporte
EnglishNederlandsDeutsch
  1. InicioInicio
  2. Base de conocimientos
  3. Security
  4. What is SQL injection, and how to protect against it

What is SQL injection, and how to protect against it

Se aplica a Any application backed by a SQL databaseAudiencia Developer, technical evaluatorÚltima revisión September 2026

Respuesta rápida

SQL injection happens when untrusted input gets pasted directly into a database query as text, letting an attacker change what the query actually does. The standard defence is a parameterised query (also called a prepared statement), which keeps user input as data rather than letting it become part of the query's structure. It's available in essentially every modern database library, and it's the real fix, not just one layer among several.

En esta página
  • How SQL injection actually happens
  • A simple illustrative example
  • The real fix: parameterised queries
  • Additional layers, not substitutes

How SQL injection actually happens

A SQL injection vulnerability starts with untrusted input, anything a user can control such as a form field, a URL parameter, or a cookie value, being concatenated directly into a database query as plain text. The application builds the query by joining strings together, sends the result to the database, and the database has no way to tell the difference between "the query the developer intended" and "the query as it now reads after the input was inserted". If that input contains SQL syntax of its own, it can change the meaning of the query entirely. An attacker who finds this can potentially read data they shouldn't see, modify records, or delete them, all through a field that was only ever meant to hold something like a username or a search term.

A simple illustrative example

Imagine a login check that builds its query like this, in plain terms: it takes the username typed into the form and inserts it directly into a string that reads something like "find the user where the username equals" whatever was typed. If a legitimate user types alice, the query ends up asking for the user named alice, which is exactly what was intended. But because the username was inserted as raw text, an attacker can type something that isn't a username at all, a fragment of SQL syntax designed to alter the query's logic, for example something that makes the "where" condition always evaluate as true regardless of what username was expected. The database doesn't see "an unusual username", it sees a modified query, and executes it as written.

Now compare that with a login check that uses a parameterised placeholder for the username instead. The query's structure, "find the user where the username equals a placeholder", is fixed and sent to the database first. The typed username is then supplied separately, as a value to slot into that placeholder, never as text that gets merged into the query itself. Whatever the attacker types is treated purely as the value being searched for, even if it contains characters that would have been dangerous in the concatenated version. The query's logic simply cannot be changed by what arrives in that field, because the database keeps the query's structure and the query's data in two separate channels from the start.

The real fix: parameterised queries

Parameterised queries, also known as prepared statements, are the standard defence, not an optional extra. They work by sending the query's structure to the database separately from the values that fill it in, so user input is always treated as data and never as part of the query's syntax, no matter what characters it contains. This isn't a niche feature: essentially every modern database library and ORM, across essentially every programming language, supports parameterised queries as a normal, idiomatic way to write a query. If a codebase is building queries by concatenating strings with user input anywhere, that's the specific pattern worth finding and replacing.

Additional layers, not substitutes

Parameterised queries are the fix for the injection mechanism itself, but two other practices are worth layering on top, as defence in depth rather than as alternatives:

  • Input validation. Checking that input looks like what it's supposed to be, an email field looks like an email, a numeric ID is actually numeric, catches malformed input early. It's a useful additional check, but it's not a substitute for parameterised queries, since validation logic can be incomplete or bypassed in ways a database driver's own parameter handling won't be.
  • Least-privilege database accounts. The database account an application connects with should only have the permissions that application actually needs. If a web application only ever needs to read and write specific tables, its database credentials shouldn't also carry permission to drop tables or read unrelated ones. This limits the damage if an injection flaw, or any other compromise, does happen, without preventing the flaw itself.

Both are worth doing. Neither replaces fixing the actual query-building pattern that lets injection happen in the first place.

Related articles

  • What is a Web Application Firewall (WAF), and how it differs from a network firewall
  • Hardening a fresh VPS: SSH keys, firewall and Fail2ban
¿Te ha resultado útil este artículo?

Informática sólida. Sin sorpresas

Tu socio para la madurez informática
Eliminamos barreras para que puedas correr
Costes previsibles y transparentes

Contacto

  • Industriestraat 53, Naaldwijk
Contacta con nosotros
Worldstream Portal (opens in a new tab)
  • Métodos de pago
  • Abuso
  • Recursos para desarrolladores
  • Centro de operaciones de red
  • Quiénes somos
  • Conoce al equipo
  • Trabaja con nosotros
  • Hazte distribuidor
  • certificaciones
  • Nuestros centros de datos
  • Nuestra red
  • Protección DDoS
  • Servidores AMD EPYC
  • Partners tecnológicos
  • Sistemas operativos
  • Vista general
  • Preguntas frecuentes
  • Casos
  • Noticias y blogs
  • Use Cases
English
Nederlands
Deutsch
English
Nederlands
Deutsch
  • Legal
  • Notificación de vulnerabilidades