How DNSSEC Enhances the Security of Your Web Application

Lipman
GuardianUI
Published in
5 min readApr 11, 2023

If you’re a developer, you’ve probably heard of DNSSEC before. But what exactly is it, and why is it important for the security of your website or app? Let’s take a closer look.

DNSSEC stands for Domain Name System Security Extensions. It’s a security protocol that adds an extra layer of protection to the DNS (Domain Name System), which is responsible for translating domain names into IP addresses. Essentially, DNSSEC is a way to digitally sign DNS records to ensure their authenticity.

The importance of DNSSEC

Why is this important? Well, without DNSSEC, your website or app is vulnerable to a type of attack called DNS poisoning. This is where an attacker intercepts and alters the DNS responses sent to a user’s computer, redirecting them to a malicious website instead of the intended one. In a recent study of 215 web3 apps conducted by GuardianUI, 80% did not have DNSSEC implemented.

Imagine you’re trying to access your favorite DEX’s app to make a swap. You type in the URL, hit enter, and the website loads.

Or so you think…

In reality, an attacker has intercepted your request and sent you to a fake website that looks just like your favorite DEX’s site. And instead of approving transactions for legit contracts, the attacker has set the contract address(es) to their personal wallet. You connect your wallet, execute the swap, and your money is gone forever.

This is just one example of how DNS poisoning can be used to steal user funds or spread malware. With DNSSEC, the chances of this happening aren’t completely eliminated, but they are reduced.

How DNSSEC works

So how does DNSSEC work? Essentially, it adds digital signatures to DNS records to ensure their authenticity. When a user makes a request to a DNS server, the server can check the digital signature to verify that the response is legitimate and hasn’t been tampered with. This makes it much harder for attackers to spoof DNS responses and redirect users to malicious sites.

Here’s how it generally works:

  1. A user makes a DNS request to a recursive DNS server: When a user wants to visit a website, their device sends a DNS request to a recursive DNS server. The recursive server doesn’t have the answer to the request itself, but it can query other DNS servers on behalf of the user to find the answer.
  2. The recursive DNS server queries authoritative DNS servers: The recursive DNS server queries authoritative DNS servers, which are responsible for managing the DNS records for a particular domain. For example, if the user is trying to access example.com, the recursive server will query the authoritative servers for example.com to get the DNS records for the site.
  3. The authoritative DNS server responds with signed DNS records: With DNSSEC enabled, the authoritative server signs the DNS records for the requested domain using a private key. The DNS records include a digital signature, which is generated using the private key, and a public key that can be used to verify the signature.
  4. The recursive DNS server verifies the digital signature: When the recursive server receives the signed DNS records, it verifies the digital signature using the public key provided by the authoritative server. If the signature is valid, the recursive server knows that the DNS records haven’t been tampered with and can trust the information in the response.
  5. The recursive DNS server returns the response to the user: With the DNS response validated, the recursive server returns the response to the user’s device, which can then use the IP address in the response to connect to the requested website.
  6. The root/Top Level Domain (TLD) servers provide trust anchors: In order for DNSSEC to work, there needs to be a chain of trust from the root/TLD servers down to the authoritative DNS servers for a particular domain. The root and TLD servers provide trust anchors, which are public keys that are used to verify the digital signatures for the DNS records at lower levels of the hierarchy.

By using digital signatures to verify the authenticity of DNS records, DNSSEC provides an additional layer of security for DNS lookups. However, it’s important to note that DNSSEC is not a panacea for all DNS-related security threats, and it can still be vulnerable to certain types of attacks, such as cache poisoning attacks. Additionally, DNSSEC can add some complexity to the DNS lookup process and may require additional maintenance to keep the digital signatures up to date.

But while DNSSEC is an important security protocol, it’s not foolproof. In fact, it can actually make your website or app more vulnerable to certain types of attacks.

DNSSEC and DDoS attacks

One such attack is called a DDoS (Distributed Denial of Service) attack. In a DDoS attack, a large number of computers or devices are used to flood a website or app with traffic, overwhelming its servers and causing it to crash. And while DNSSEC can help protect against DNS poisoning, it can also make it easier for attackers to carry out a DDoS attack.

Here’s how it works:

When a user makes a request to a DNS server that’s protected by DNSSEC, the server has to perform additional calculations to verify the digital signature on the DNS record. This takes extra time and resources, which can make it easier for attackers to flood the server with requests and cause a DDoS attack.

Tips for Protecting your website or app

So what can you do to protect your website or app from both DNS poisoning and DDoS attacks? Please note: Not all top level domains support DNSSEC and not all hosting providers support DNSSEC. Here’s a resource to see if your TLD is supported.

Here are a few additional tips:

  • Implement DNSSEC on your website or app. While it’s not a perfect solution, it can help reduce the chances of DNS poisoning.
  • Use a content delivery network (CDN) to help protect against DDoS attacks. A CDN can help distribute traffic across multiple servers, making it harder for attackers to overwhelm any one server.
  • Monitor your website or app for suspicious activity. For example, GuardianUI will monitor your app to make sure your frontend is creating the correct smart contract interactions such as transactions point to the correct contracts and approvals give access to user funds as intended.
  • Educate your users about security best practices. Encourage them to use strong passwords, avoid clicking on suspicious links, and report any suspicious activity.

DNSSEC is an important security protocol that can help protect your website or app from DNS poisoning. But like any security measure, it’s not foolproof. By taking additional steps to protect against frontend attacks and educating your users about security best practices, you can help keep your website and app safe and secure.

About GuardianUI

GuardianUI is the testing and monitoring platform for web3 frontends. Our SaaS platform automates end-to-end testing, application monitoring for web3 critical paths, and real-time alerting to ensure deployed apps create the expected smart contract interactions for users.

Apply for early access by filling out this form.

https://www.guardianui.com/

--

--