¿Cómo HTML5 está cambiando la seguridad web?
De Google anuncio que terminaron con flash fue el último clavo en el ataúd de Flash.
Incluso antes de eso, los tecnócratas famosos como Steve Jobs habló abiertamente contra Flash.
With the demise of flash and rise of HTML5 a new era has been ushered in that features better looking and better functioning websites that are compatible with mobiles and PCs alike.
Transferir datos y recibirlos también se ha vuelto mucho más sencillo que antes.
Sin embargo, presenta desafíos únicos que deben ganarse.
The advantage with this is that html5 takes cross-browser support and functionality to a whole new level.
Certain browsers don’t support individual site elements, and it’s frustrating to have to change the site elements to keep up with appearances.
HTML5 discards that requirement since all modern browsers support.
Intercambio de recursos entre orígenes
El intercambio de recursos de origen cruzado (CORS) es una de las características más influyentes de html5 y también una que presagia la mayor cantidad de posibilidades de errores y ataques de hackers.
CORS defines headers to help enable sites to define origins and facilitate contextual interactions.
With html5 CORS mutes the fundamental security mechanism on browsers called the Regla del mismo origen.
Under the same origin policy, a browser can allow a webpage to access data from a second webpage only if both web pages have the same origin.
¿Qué es un origen?
An origin is a combination of URI scheme, host name, and port number. This policy prevents malicious scripts from executing and accessing data from web pages.
CORS relaja esta política al permitir que diferentes sitios accedan a los datos para permitir la interacción contextual.
Esto puede llevar a un pirata informático a tener acceso a datos confidenciales.
Por ejemplo,
Si ha iniciado sesión en Facebook y permanece conectado y luego visita otro sitio, entonces es posible que los atacantes puedan robar información y hacer lo que quieran en su cuenta de Facebook aprovechando la política relajada de origen cruzado.
On a slightly more tepid note, if a user is logged into his banking account and forgets to log out the hacker could get access to the user’s credentials, his transactions or even create new transactions.
Browsers by storing user details leave session cookies open for exploit.
Hackers can also meddle with the headers to trigger unvalidated redirects.
no válidoated redirects can happen when browsers accept untrusted input. This, in turn, forwards a redirect request. The untrusted URL can be modified to add an input to the malicious site and hence launch phishing scams by providing URLs that appear identical to the actual site.
no válidoated redirect and forward attacks can also be used to maliciously craft a URL that would pass the application’s access control check and then forward the attacker to privileged functions that they would typically not be able to access.
Here’s what developers should take care of to prevent these things from happening.
- Los desarrolladores deben asegurarse de que las URL se pasen para abrir. Si se trata de dominios cruzados, puede ser vulnerable a las inyecciones de código.
- Also, pay attention if the URLs are relative or if they specify a protocol. A relative URL doesn’t specify a protocol, i.e., we wouldn’t know if it starts with HTTP or https. The browser assumes that both are true.
- No confíe en el encabezado de Origin para las comprobaciones de control de acceso, ya que pueden falsificarse fácilmente.
¿Cómo saber si CORS está habilitado en un dominio en particular?
Well, you can use developer tools in the browser a examinar el encabezado.
Mensajería entre dominios
Cross-domain messaging was previously disallowed in browsers to prevent ataques de secuencias de comandos entre sitios.
This also prevented legitimate communication between websites from happening which made the bulk of cross-domain messaging now.
La mensajería web permite que diferentes API interactúen con facilidad.
Parte superiorrevent cross-scripting attacks here’s what developers should do.
They should state the expected origin of the message
- Los atributos de origen siempre deben comprobarse y verificarse los datos.
- The receiving page should always check the origin attribute of the sender. This helps verify that the received data is indeed sent from the expected location.
- La página de recepción también debe realizar la validación de entrada para garantizar que los datos estén en el formato requerido.
- Los mensajes intercambiados deben interpretarse como datos, no como códigos.
Mejor almacenamiento
Another feature of html5 is it allows for better storage. Instead of relying on cookies to keep track of user data, the browser is enabled to store data.
HTML5 allows for storage across multiple windows, has better security and retains data even after closing a browser. Local storage is possible without browsotros complementos.
Esto significa diferentes tipos de problemas.
Developers should take care of the following things to prevent attackers from stealing information.
- Si un sitio almacena las contraseñas de los usuarios y otra información personal, los piratas informáticos podrían acceder a él. Estas contraseñas, si no están cifradas, se pueden robar fácilmente a través de las API de almacenamiento web. Por lo tanto, se sugiere encarecidamente que todos los datos valiosos del usuario estén encriptados y almacenados.
- Adiciónally, many malware payloads have already started scanning browser caches and storage APIs to find information on users like transactional and financial information.
Pensamientos conclusivos
HTML5 ofrece excelentes oportunidades para que los desarrolladores web modifiquen y hagan las cosas mucho más seguras.
The bulk of the work in providing a secure environment falls on the browsers though.
Si está interesado en obtener más información, consulte "Aprenda HTML5 en 1 hora" curso.