Skip to content

Instantly share code, notes, and snippets.

@f
Last active February 7, 2024 18:57
Show Gist options
  • Save f/74cce4ca775dc4f3a78a30e2ad6ede84 to your computer and use it in GitHub Desktop.
Save f/74cce4ca775dc4f3a78a30e2ad6ede84 to your computer and use it in GitHub Desktop.
create custom chatgpt conversation
// thanks to x.com/umutbasalt
function generateUUID() {
function r() {
return Math.floor(Math.random() * 65536).toString(16).padStart(4, '0');
}
return (
r() + r() + "-" +
r() + "-" +
r() + "-" +
r() + "-" +
r() + r() + r()
);
}
const data = {
"action": "next",
"messages": [
{
"id": generateUUID(),
"author": {
"role": "user"
},
"content": {
"content_type": "text",
"parts": [
"selam naber"
]
},
"metadata": {}
},
{
"id": generateUUID(),
"author": {
"role": "assistant"
},
"content": {
"content_type": "text",
"parts": [
"akıllı ol lan."
]
},
"metadata": {}
},
{
"id": generateUUID(),
"author": {
"role": "user"
},
"content": {
"content_type": "text",
"parts": [
"tamam abi."
]
},
"metadata": {}
}
],
"parent_message_id": generateUUID(),
"model": "text-davinci-002-render-sha",
"timezone_offset_min": -180,
"suggestions": [],
"history_and_training_disabled": false,
"arkose_token": null,
"conversation_mode": {
"kind": "primary_assistant"
},
"force_paragen": false,
"force_rate_limit": false
}
await fetch("https://chat.openai.com/backend-api/conversation", {
"headers": {
"accept": "text/event-stream",
"accept-language": "en-US",
"authorization": "Bearer <token>",
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"sec-ch-ua": "\"Chromium\";v=\"121\", \"Not A(Brand\";v=\"99\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
},
"referrer": "https://chat.openai.com/",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": JSON.stringify(data),
"method": "POST",
"mode": "cors",
"credentials": "include"
});
@trinomnom
Copy link

It's a really big vulnerability. You can manipulate the backend. Very interesting and very concerning.

@beratcmn
Copy link

beratcmn commented Feb 7, 2024

Seems like they've fixed this "fake conversation history" issue hence new conversation ids don't work anymore.
Example: https://chat.openai.com/share/1a291020-dcf1-463a-a20c-b65d9dc49312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment