Skip to content

Commit f60efef

Browse files
authored
Merge pull request #15652 from mestizo/google-gemini-api-key-check
Create Google Gemini API Key Check
2 parents 5551c03 + 5cbd4a3 commit f60efef

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
id: google-gemini-key-exposure
2+
3+
info:
4+
name: Google Gemini API Key - Exposure
5+
author: Mestizo
6+
severity: high
7+
description: |
8+
Detects exposed Google API keys and verifies access to the Gemini Files API endpoint. Exploitation can result in unauthorized data exposure, quota exhaustion, and potential financial loss.
9+
metadata:
10+
max-request: 2
11+
verified: true
12+
tags: exposure,google,apikey,gemini
13+
14+
http:
15+
- method: GET
16+
path:
17+
- "{{BaseURL}}"
18+
19+
extractors:
20+
- type: regex
21+
name: google_api_key
22+
part: body
23+
regex:
24+
- 'AIza[0-9A-Za-z\-_]{35}'
25+
internal: true
26+
27+
- method: GET
28+
path:
29+
- "https://generativelanguage.googleapis.com/v1beta/files?key={{google_api_key}}"
30+
31+
matchers:
32+
- type: dsl
33+
dsl:
34+
- "status_code == 200"
35+
- '!contains(body, "error")'
36+
- '!status_code == 403'
37+
condition: and

0 commit comments

Comments
 (0)