@@ -754,3 +754,44 @@ payload is `application/json` then the client MUST NOT rely on the body to be a
754754well-formed _ GraphQL response_ since the source of the response may not be the
755755server but instead some intermediary such as API gateways, proxies, firewalls,
756756etc.
757+
758+ # Non-normative notes
759+
760+ ## Security
761+
762+ In this specification, GET requests are not supported for mutations due to
763+ security concerns. GET requests expose variables to logging mechanisms and
764+ intermediaries due to the URL encoding of parameters, which can lead to
765+ sensitive data being inadvertently logged. Furthermore, GET requests are
766+ considered "simple requests" under CORS (Cross-Origin Resource Sharing), meaning
767+ they bypass preflight checks that add a layer of security.
768+
769+ On the other hand, using ` application/json ` for request bodies mandates a CORS
770+ preflight request, adding a security layer by ensuring the client has explicit
771+ permission from the server before sending the actual request. This is
772+ particularly important in mitigating cross-site request forgery (CSRF) attacks.
773+
774+ It's important to note that "simple requests" like those using
775+ ` application/x-www-form-urlencoded ` or ` multipart/form-data ` do not have the
776+ same CORS behavior, and thus do not undergo the same preflight checks.
777+ Implementers should be aware of the security implications of using these types
778+ of requests. While they can be secured with the right headers enforced by the
779+ server, it is crucial to understand and properly account for the security risks
780+ involved.
781+
782+ To mitigate these risks, it is recommended that servers require a custom header
783+ to ensure requests are not "simple." For instance, a ` GraphQL-Require-Preflight `
784+ header can be used to indicate that a preflight check has occurred, providing an
785+ additional layer of security.
786+
787+ For more detailed security considerations, please refer to
788+ [ RFC 7231] ( https://tools.ietf.org/html/rfc7231 ) ,
789+ [ RFC 6454] ( https://tools.ietf.org/html/rfc6454 ) , and other relevant RFCs.
790+
791+ ## Request format compatibility
792+
793+ Supporting formats not described by this specification, such as XML or Protobuf,
794+ may have potential conflicts with future versions of this specification as
795+ ongoing development aims to standardize and ensure the security and
796+ interoperability of GraphQL over HTTP. For this reason, it is recommended to
797+ adhere to the officially recognized formats outlined here.
0 commit comments