/

CVE-2026-35198

Severity:

CRITICAL RISK

(9.0)

Stored Cross-Site Scripting (CWE-79) in HeyForm Builder

CVE-2026-35198

Deferred

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79

Impact:

Account Takeover via Privilege Escalation

Severity:

CRITICAL RISK

(9.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

HeyForm contains a stored cross-site scripting vulnerability that allows low-privileged team members to embed malicious JavaScript within forms.

When a team owner views the compromised form, the script executes in their browser context, potentially leading to full account takeover and privilege escalation.

Affected context

This vulnerability occurs in the HeyForm form builder interface where user-supplied content is persisted and later rendered in team owners' browsers.

It typically manifests when textual or HTML-like fields are stored without robust sanitization or output encoding, and then displayed in privileged views.

The issue is relevant in multi-user team environments where lower-privileged members can create or modify form content that higher-privileged owners subsequently review.

Exploit preconditions

  • Attack surface: Web-based HeyForm form builder and team dashboard
  • Required access: Low-privileged team membership with permissions to create or edit forms or related content fields
  • Trigger point: A team owner (or another higher-privileged user) viewing the crafted form or associated page where the stored payload is rendered
  • Why exploitation is possible: User-controlled data is stored and later inserted into HTML responses without appropriate context-aware output encoding or sanitization, allowing injected JavaScript to run in the victim's browser

Why this happens

The root cause aligns with CWE-79: Improper Neutralization of Input During Web Page Generation (Cross-Site Scripting).

The form builder persists user-controlled content and later renders it into dynamic pages without consistently applying context-aware escaping (e.g., HTML, attribute, or JavaScript encoding) or sanitizing unsafe markup.

As a result, an attacker's crafted payload becomes part of the DOM and is treated as executable script rather than inert data, enabling the browser to run arbitrary JavaScript in the context of the victim's authenticated session.

Potential impact

  • An attacker may gain full access to a team owner's account session
  • Malicious scripts could perform unauthorized actions as the victim, including changing settings or adding new administrators
  • Attackers can potentially exfiltrate sensitive data accessible to the compromised account, such as form responses or API tokens
  • Stored payloads may serve as a pivot for broader organizational compromise if integrated services or single sign-on are in use

General mitigation guidance

Effective mitigation focuses on treating all user-supplied content as untrusted and separating data from executable code.

Common defensive patterns include:

  • Applying strict, context-aware output encoding for all dynamic content rendered into HTML, attributes, URLs, or JavaScript blocks
  • Using a robust HTML sanitization layer that removes or neutralizes script tags, event handlers, and dangerous attributes from rich-text inputs
  • Adopting templating engines or component frameworks that escape content by default and discourage manual string concatenation for HTML generation
  • Implementing role and permission boundaries that minimize the ability of lower-privileged users to inject active content visible to higher-privileged users
  • Enforcing secure defaults for new fields or widgets, ensuring they are rendered as inert text unless explicitly whitelisted as safe markup

How teams detect issues like this

Detection typically combines code-level and runtime techniques:

  • Static analysis rules that flag direct insertion of user-controlled variables into HTML templates, inline event handlers, or script blocks without encoding
  • Secure coding checklists and code review practices that require verification of output encoding for all data rendered in web views, especially those visible to privileged roles
  • Automated scanning with web application scanners that test form fields and rich-text inputs for stored XSS behavior across different views and user roles
  • Policy-based linting or templating restrictions that prohibit inline JavaScript string concatenation and encourage safe rendering patterns
  • Centralized security review of shared UI components to ensure they consistently encode or sanitize data before display

Sources

SourceLink
github.comgithub.com/heyform/heyform/commit/cc97d27a57ae400fec23abf5dcf6f9533c3b5db3
github.comgithub.com/heyform/heyform/security/advisories/GHSA-chmm-jqpm-3pwx

Frequently asked

questions

Exploitation is generally constrained to environments where low-privileged team members can modify form content that team owners subsequently view. Within such teams, any owner who opens a compromised form page may be affected.

The attacker must have at least low-privileged team access with the ability to create or edit forms or related content fields. Anonymous users typically cannot exploit this directly unless configurations expose form editing to them.

The most robust fix is to enforce context-aware output encoding on all user-supplied content before it is rendered and, where rich text is required, to apply strict HTML sanitization that removes scripts and event-driven attributes. Using frameworks that escape content by default reduces the chances of reintroducing similar flaws.

Adopting a secure-by-default rendering model is key: use templating systems that automatically escape values, avoid building HTML through manual string concatenation, enforce central sanitization routines for rich-text fields, and integrate XSS-focused checks into code review, testing, and automated scanning pipelines.

Find out what's already
exploitable in your codebase.