Skip to product menu
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Payroll software with automated tax payments and filing.

Try now
New

Robotic process automation software to automate high-volume, rule-based tasks.

Try for free
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Privacy-friendly application analytics solution.

Try for free

Sales

 
CRM

Comprehensive CRM platform for customer-facing teams.

CRM
 
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
 
Forms

Build online forms for every business need.

Forms
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Sign

Digital signature app for businesses.

Sign
 
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

 
Social

All-in-one social media management software.

Social
 
Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
 
Forms

Build online forms for every business need.

Forms
 
Survey

Design surveys to reach and interact with your audience.

Survey
 
Sites

Online website builder with extensive customisation options.

Sites
 
PageSense

Website conversion optimization and personalisation platform.

PageSense
 
Backstage

End-to-end event management software.

Backstage
 
Webinar

Webinar platform for webcasting online webinars.

Webinar
 
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
 
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
 
Publish

Manage all your local business listings on a single platform.

Publish
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Sign

Digital signature app for businesses.

Sign
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
 
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
 
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce

 
Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

 
Desk

Helpdesk software to deliver great customer support.

Desk
 
Assist

Remote support and unattended remote access software.

Assist
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
FSM

End-to-end field service management platform for service businesses.

FSM
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

 
Books

Powerful accounting platform for growing businesses.

Books
 
FREE
Invoice

100% Free invoicing solution.

Invoice
 
Expense

Effortless expense reporting platform.

Expense
 
Inventory

Powerful stock management and inventory control software.

Inventory
 
Billing

End-to-end billing solution for your business.

Billing
 
Checkout

Collect payments online with custom branded pages.

Checkout
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Practice

Practice management software for accounting firms.

Practice
 
Sign

Digital signature app for businesses.

Sign
 
Commerce

eCommerce platform to manage and market your online store.

Commerce
 
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email and Collaboration

 
Mail

Secure email service for teams of all sizes.

Mail
 
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
 
Writer

Word processor for focused writing and discussions.

Writer
 
Sheet

Spreadsheet software for collaborative teams.

Sheet
 
Show

Create, edit, and share slides with a sleek presentation app.

Show
 
Notebook

Beautiful home for all your notes.

Notebook
 
Cliq

Stay in touch with teams no matter where you are.

Cliq
 
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
TeamInbox

Shared inboxes for teams.

TeamInbox
 
WorkDrive

Online file management for teams.

WorkDrive
 
Sign

Digital signature app for businesses.

Sign
 
Office Suite

Powerful collaborative work platform for teams.

Office Suite
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
 
Learn

Knowledge and learning management platform.

Learn
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
ToDo

Collaborative task management for individuals and teams.

ToDo
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
 
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

 
People

Organize, automate, and simplify your HR processes.

People
 
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
 
Expense

Effortless expense reporting platform.

Expense
 
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
Shifts

Employee scheduling and time tracking app.

Shifts
 
Sign

Digital signature app for businesses.

Sign
 
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

 
Creator

Build custom apps to simplify business processes.

Creator
 
Directory

Workforce identity and access management solution for cloud businesses.

Directory
 
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
 
Vault

Online password manager for teams.

Vault
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
Assist

Remote support and unattended remote access software.

Assist
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA

BI and Analytics

 
Analytics

Modern self-service BI and analytics platform.

Analytics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
 
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT

Project Management

 
Projects

Manage, track, and collaborate on projects with teams.

Projects
 
Sprints

Planning and tracking tool for scrum teams.

Sprints
 
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo

Developer Platforms

 
Creator

Build custom apps to simplify business processes.

Creator
 
Flow

Automate business workflows by creating smart integrations.

Flow
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
 
NEW
Apptics

Application analytics for all apps.

Apptics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep

IoT

 
NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT

Search Result

 
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
 
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
 
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
 
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
 
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
 
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
 
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho One
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Marketplace
Skip to main content

How can you secure your webhooks?

  • Published : October 4, 2023
  • Last Updated : October 16, 2024
  • 1.8K Views
  • 8 Min Read

Let's start off by setting the context. A webhook is an HTTP request used to send event-driven notifications from one application to another. For example, webhooks in your email provider can relay the notification of email delivery to your application. You can read our detailed article on webhooks here.

Webhooks are a great way to transfer event information between applications. They are instant, effective, and don’t require constant polling, but they’re vulnerable to attacks. Webhook requests are sent to public URLs that can be accessed by any unauthorized and malicious person.

These threats could come in many forms, such as impersonated messages, tampered messages, or completely unauthorized requests. With the threats coming in different shapes and sizes, the security also must be multi-fold. There are multiple ways to secure a webhook, and it’s best to use a combination of these security measures to obtain maximum security. In this article, we’ll talk at length about the different security measures available to secure and protect your webhook.

Encrypt the data 

Webhook requests are often made in HTTP protocol. In this protocol, information is transported in plain text, which means anyone who intercepts the message will be able to read it.

Before making sure that the message cannot be intercepted, you can take the simplest webhook security measure to ensure that even if it is intercepted, the message isn't readable.

You can do this by using the HTTPS protocol instead of HTTP. It adds an additional layer of security to HTTP. All data transferred through HTTPS is encrypted, making it difficult to interpret for attackers. You can do this by updating your client to HTTPS using a SSL certificate.

Implement authentication tokens or basic authentication 

As previously mentioned, webhook endpoints are public URLs that can be accessed by anyone. Because of their nature, they’re vulnerable to unauthorized requests. You need a security measure in place that will vet the sender to ensure the request originates from the right place.

To verify the source of the request, you can use authentication tokens or basic authentication. It’s one of the simplest ways to authenticate the source, but it does come with its own shortcomings.

You can add an authentication token to the header of your webhook request that the receiving application can verify to ensure the authenticity of the request. If the token matches, the request is valid. If you're a webhook provider, you can make it easier for your clients by providing them the provisions for authentication tokens or keys.

Much like authentication tokens, you can also use basic authentication to verify the request source. The webhook endpoint has a specific username and password that you have to add to your webhook header. On receiving the request, the listening application will verify the username and password before accepting the request.

Alternatively, you can also have the receiving application whitelist the IP address of valid requests to eliminate requests originating from other IP addresses. However, this might not work well for users who prefer flexibility with their originating IP addresses.

All three of these methods are based on a shared secret. While they’re good security measures, they fall short of being airtight because the secrets are shared in plain text. Should the attacker intercept the username and password or the authentication token, this security measure would fail. Additionally, while these methods help authenticate the source, they don’t ensure message integrity. Hence, these measures are best used alongside other measures mentioned in this article.

Sign webhooks with HMAC 

Hash-based Message Authentication Code (HMAC) is the most popular method of securing a webhook by a good margin. As the name suggests, it uses a hash algorithm to create a unique signature for the webhook request to secure it. The exact type of hash algorithm used is agreed upon by the sender and receiver of the webhook. Here’s how it works.

On the sender's end:

  1. Signature creation: The webhook request sender generates the signature. The payload of the webhook and the secret code are combined together and then a hash algorithm, like SHA1 or SHA256, is used to encode this combination to create the signature.

  1. Attach signature: The signature is then added to the webhook header and the request is sent.

On the receiver's end:

  1. Re-create the signature: On arrival of the request, the receiver uses the agreed-upon hash algorithm and secret code on the content to re-create the signature.

  1. Verify the match: The re-created signature is compared with the signature that came with the webhook header. If both signatures match, the request is considered valid and untampered with.

HMAC signing is a great way to ensure that the webhook request has not been tampered with. It has some significant advantages over authentication tokens and the basic authentication method:

  • The shared secret isn’t transported with the request, making it impossible for any attacker to gain access to it. Only the signature generated using the secret is sent with the request.

  • This method helps with the authentication of the sender as well as ensures that the request content hasn’t been tampered with.

While HMAC is a very good security measure, it only works well when implemented well. Here are some best practices for both providers and users to follow while implementing HMAC signing for webhooks:

  • Ensure simplicity: Webhook providers should avoid adding steps that increase the complexity of signature generation without improving the security of the process.

  • Good documentation: Providers should give good, detailed documentation to help the users with the implementation. Ensure that each step is well explained, and all of the required information is presented to the user.

  • Unique secrets: While signing webhooks, use unique secrets that don’t coincide with credentials of other accounts or systems. It helps to keep the secret code random and unassociated to identifiers.

  • Key rotation: Both providers and users need to give provisions for key rotation. Much like any secret keys or codes, it’s always better to periodically change the key used for HMAC signing to avoid compromise. The implementation should allow for the keys to be rotated without any interruption to the request during sending and receiving.

  • Forward compatibility: Any security process should be prepared for versioning. HMAC should be implemented with the ability for upgrades to more advanced hash algorithms or signing processes.

Add timestamps to requests 

Attackers don't always intercept a message or impersonate a request. Sometimes they simply re-create the request in its entirety at their convenience. These attacks are called replay attacks. While in most cases sending the request twice wouldn't do much harm, in other cases where a significant action is triggered by the webhook, replay attacks can be extremely harmful.

To prevent these replay attacks, you can add timestamps to your requests. These timestamps are best used in combination with HMAC signing, in which case, apart from the request body and secret code, a timestamp is also added before the hash algorithm is used to encode the signature.

When the receiver gets the request, they decode the timestamp. If the request has been received within an acceptable duration from the timestamp (say five minutes), the request is accepted. If significant time has elapsed after the timestamp, the receiver rejects the request.

Use asymmetric key encryption 

An asymmetric key encryption is very similar to HMAC. It only varies in the aspect that instead of one secret code and one hashing algorithm, in asymmetric encryption, there are two keys—a public key and a private key. One is used by the sender to encrypt the data, and the other is used by the receiver to verify the data.

Here’s how it works:

  1. The sender uses its private key to create a signature that’s added to the header of the webhook request.

  1. On receiving the request, they run the public key, the request content and signature in the header through a verifier like the Elliptical Curve Digital Signature Algorithm (ECDSA) or the Rivest-Shamir-Adleman algorithm (RSA).

  1. If the verifier returns a positive, the request is accepted.

The main difference between this and HMAC is that, in HMAC, the signature is re-created whereas here, it’s run through a verifier to check its authenticity. Other than that, the implementation best practices suggested for HMAC also applies to asymmetric encryption.

Mutual authentication with TLS 

While all of the previous security measures can ensure message and sender authenticity, one missing piece is the verification of the receiver. Much like attackers creating unauthorized requests, they could route authentic requests to unauthorized destinations. This could lead to sensitive information ending up in the hands of the wrong people.

Mutual TLS is the perfect way to ensure that there is authentication on both sides. The receiver verifies the sender and the sender verifies the receiver in a single authentication process.

Before the webhook request is sent, a TLS handshake is initiated between the sender and receiver where each side is required to show their TLS certificates. After the certificates have been authenticated, the webhook request is sent through. If one of the parties is unauthorized, they won’t request the TLS certificate, and the authentication will fail.

This is a great way to protect your webhook, but it’s difficult to configure and might not be absolutely necessary for all webhooks.

In a nutshell, here are the available security measures and what they do:

  • Data encryption (e.g., HTTPS): Reduces the readability of data during transit.

  • Authentication tokens and basic authentication: Helps verify the sender.

  • HMAC: Helps verify the sender and ensure that the request hasn't been tampered with, using hash algorithms.

  • Asymmetric encryption: Helps verify the sender and the message’s integrity using public and private key encryption mechanisms.

  • Timestamps: Best used in combination with HMAC or asymmetric encryption and helps avoid replay attacks.

  • Mutual TLS: Helps authenticate both sender and receiver using mutual authentication

A summary of best practices 

We’ve seen the different security measures available to secure your webhooks. Here are some things to keep in mind irrespective of the authentication method you choose to use.

For senders:

  • Avoid unnecessary complexities in security measures like signature generation.

  • Provide detailed and accurate documentation for implementation.

  • If you're a webhook provider, give a provision to test the webhook.

  • Choose an appropriately random secret code to be used in these authentication methods.

  • Store the key with utmost safety and precaution.

  • Make accommodations for key rotation and future upgrades.

  • Ensure you implement the highest version of security available, such as the most secure algorithm.

  • If convenient, provide an IP that your webhook requests will come from.

For receivers:

  • Ensure that you’re making use of all of the security features available from the sender's side.

  • Accept requests through protected HTTPS protocols.

  • Safeguard your secret codes while in storage.

  • Rotate secrets/keys and upgrade processes when possible.

  • Restrict the requests you can receive wherever possible through IP restriction and other similar measures.

  • Call back the sender service from a different channel if the API endpoint is provided in the header to verify the sender.

Zoho ZeptoMail is a transactional email service that provides webhooks along with great security features to keep them protected against threats and attacks. Take a look at our webhooks documentation here.

Related Topics

Leave a Reply

Your email address will not be published. Required fields are marked

By submitting this form, you agree to the processing of personal data according to our Privacy Policy.

You may also like