{"id":1702,"date":"2026-12-01T06:08:24","date_gmt":"2026-12-01T06:08:24","guid":{"rendered":"https:\/\/technewztop.net.in\/news\/?p=1702"},"modified":"2026-12-01T06:47:41","modified_gmt":"2026-12-01T06:47:41","slug":"check-website-leaking-api-keys","status":"publish","type":"post","link":"https:\/\/technewztop.net.in\/news\/check-website-leaking-api-keys\/","title":{"rendered":"Is Your Website Leaking API Keys? How to Check in 10 Minutes"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">AI app builders make it possible to launch a website in a weekend. They also make one mistake very easy: putting a secret key inside the code that every visitor downloads. Bots look for these keys all day, and a stolen AI key can be used on your bill.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You do not need to be a programmer to check. Here is how.<\/span><\/p>\n<h2><b>What counts as a leak?<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1703 size-full\" src=\"https:\/\/technewztop.net.in\/news\/wp-content\/uploads\/2026\/12\/check-website-leaking-api-keys-diagram.png\" alt=\"Is Your Website Leaking API Keys? How to Check in 10 Minutes\" width=\"700\" height=\"428\" srcset=\"https:\/\/technewztop.net.in\/news\/wp-content\/uploads\/2026\/12\/check-website-leaking-api-keys-diagram.png 700w, https:\/\/technewztop.net.in\/news\/wp-content\/uploads\/2026\/12\/check-website-leaking-api-keys-diagram-300x183.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><br \/>\n<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Not every key in a page is a problem. Some are meant to be public.<\/span><\/p>\n<table>\n<thead>\n<tr>\n<th><span style=\"font-weight: 400;\">Kind of key<\/span><\/th>\n<th><span style=\"font-weight: 400;\">Public in the browser?<\/span><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400;\">Stripe publishable key (pk_&#8230;)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Yes, by design<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Supabase anon key<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Yes, if row level security is on<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Firebase web config<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Usually yes, if rules are set<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Stripe secret key (sk_&#8230;)<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Never<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">OpenAI or Anthropic key<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Never<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Supabase service role key<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Never<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">AWS secret access key<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Never<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><b>Check by hand<\/b><\/h2>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open your site in Chrome on a computer.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Press F12 (or Cmd + Option + I on a Mac) to open developer tools.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open the <\/span><b>Network<\/b><span style=\"font-weight: 400;\"> tab and reload the page.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Press Ctrl + F (Cmd + F) in that tab. This searches inside the files the page loaded.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Search for sk-, sk_live, service_role, AKIA and SECRET.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">If you find something, look at what is around it. The letters sk- can also be part of an ordinary word, so only a long random value counts.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Then try these addresses on your own domain: \/.env, \/.env.local and \/.git\/config. All of them should show a &#8220;not found&#8221; page.<\/span><\/p>\n<h2><b>Check automatically<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Going through every file takes patience, because modern sites split their code into dozens of pieces. A scanner does it in one go. The free <\/span><a href=\"https:\/\/hostwares.com\/tools\/api-key-scanner\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">API key checker from Hostwares<\/span><\/a><span style=\"font-weight: 400;\"> reads the page, its scripts and any public source maps, the same files any visitor&#8217;s browser can download, and does not use a key if it finds one. Only scan websites that belong to you or that you have permission to test.<\/span><\/p>\n<h2><b>Found a key? Follow this order<\/b><\/h2>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Revoke it<\/b><span style=\"font-weight: 400;\"> in the provider&#8217;s dashboard. This comes first. Removing it from the page does not help, because copies may already exist.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Create a new one.<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Move it to the server.<\/b><span style=\"font-weight: 400;\"> The browser should call your own server, and your server calls the AI provider.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Publish the site again<\/b><span style=\"font-weight: 400;\"> and repeat the check.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Look at the usage page<\/b><span style=\"font-weight: 400;\"> for calls you do not recognise, and set a spending limit.<\/span><\/li>\n<\/ol>\n<h2><b>Why it happens so often<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Build tools such as Vite and Next.js copy some variables into the public files on purpose. Anything that starts with VITE_ or NEXT_PUBLIC_ is visible to everyone. When an AI builder adds a chatbot quickly, it sometimes puts the key behind exactly such a name.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A good habit: before every launch, search your own site for the word &#8220;key&#8221;. It takes a minute, and it is much cheaper than a surprise bill.<\/span><\/p>\n<p><i><span style=\"font-weight: 400;\">Written by the Hostwares team.<\/span><\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI app builders make it possible to launch a website in a weekend. They also make one mistake very easy: putting a secret key inside the code that every visitor downloads. Bots look for these keys all day, and a stolen AI key can be used on your bill. You do not need to be &#8230; <a title=\"Is Your Website Leaking API Keys? How to Check in 10 Minutes\" class=\"read-more\" href=\"https:\/\/technewztop.net.in\/news\/check-website-leaking-api-keys\/\" aria-label=\"Read more about Is Your Website Leaking API Keys? How to Check in 10 Minutes\">Read more<\/a><\/p>\n","protected":false},"author":26,"featured_media":1704,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-1702","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/posts\/1702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/comments?post=1702"}],"version-history":[{"count":2,"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/posts\/1702\/revisions"}],"predecessor-version":[{"id":1706,"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/posts\/1702\/revisions\/1706"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/media\/1704"}],"wp:attachment":[{"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/media?parent=1702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/categories?post=1702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/technewztop.net.in\/news\/wp-json\/wp\/v2\/tags?post=1702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}