Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/GraphQL/ParseGraphQLServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ class ParseGraphQLServer {
new window.EmbeddedSandbox({
target: "#sandbox",
endpointIsEditable: false,
initialEndpoint: "${JSON.stringify(this.config.graphQLPath)}",
initialEndpoint: ${JSON.stringify(this.config.graphQLPath)},
handleRequest: (endpointUrl, options) => {
return fetch(endpointUrl, {
...options,
headers: {
...options.headers,
'X-Parse-Application-Id': "${JSON.stringify(this.parseServer.config.appId)}",
'X-Parse-Master-Key': "${JSON.stringify(this.parseServer.config.masterKey)}",
'X-Parse-Application-Id': ${JSON.stringify(this.parseServer.config.appId)},
'X-Parse-Master-Key': ${JSON.stringify(this.parseServer.config.masterKey)},
},
Comment on lines +176 to 178
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Do not inject X-Parse-Master-Key into client HTML — critical secret leak.

This renders the master key into a page any viewer can “View Source” and exfiltrate, granting full admin access. Remove it (or strictly gate behind an explicit opt-in and protect the route with auth/IP allowlist). Also avoid sending an undefined value as a header.

Minimal patch:

               headers: {
                 ...options.headers,
-                'X-Parse-Application-Id': ${JSON.stringify(this.parseServer.config.appId)},
-                'X-Parse-Master-Key': ${JSON.stringify(this.parseServer.config.masterKey)},
+                'X-Parse-Application-Id': ${JSON.stringify(this.parseServer.config.appId)},
               },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'X-Parse-Application-Id': ${JSON.stringify(this.parseServer.config.appId)},
'X-Parse-Master-Key': ${JSON.stringify(this.parseServer.config.masterKey)},
},
headers: {
...options.headers,
'X-Parse-Application-Id': ${JSON.stringify(this.parseServer.config.appId)},
},
🤖 Prompt for AI Agents
In src/GraphQL/ParseGraphQLServer.js around lines 176 to 178, the code injects
the X-Parse-Master-Key into client-rendered HTML which leaks a critical secret;
remove the master key from any headers sent to clients and only include it for
server-to-server calls behind strict controls. Fix by deleting the
X-Parse-Master-Key header from the client response path (or gate its inclusion
behind an explicit opt-in flag plus auth/IP allowlist), and ensure headers are
only added when values are defined (check for undefined before adding any
header).

})
},
Expand Down