top of page

React2Keys Stole Cloud Keys From Unpatched Next.js Servers

Writer: Inception Security
Inception Security
10 minutes ago
14 min read
Three-panel comic: an unpatched Next.js server, an attacker copying secrets and planting an SSH key, and a defender rotating secrets and removing the key.

What this means for your clients: If a website or web app you run missed a critical update released last December, assume the passwords and keys stored on that server were stolen, and ask your IT provider to change every one of them this week.


A new website gets its TLS certificate, the certificate lands in a public log, and within minutes a scanner has the domain on its list. If the site runs an unpatched Next.js server, the attacker's code is soon running inside it and the keys are taken in one automated pass. That is the React2Keys campaign as CloudSEK reconstructed it from the attacker's own infrastructure: more than 50,000 credentials from servers tied to over 400 organizations, then used against the cloud accounts, databases, Git repositories, secrets managers and AI subscriptions they opened.


As of 7:05 AM MST, Monday, November 30, 2026, CloudSEK reports the React2Keys campaign stole more than 50,000 credentials from servers left exposed to React2Shell (CVE-2025-55182), a flaw CISA has listed as known exploited since December 2025, and the fix is a patched React and Next.js release plus rotating every secret the server could read.


What happened


React2Shell is a flaw in React Server Components that lets an unauthenticated request run code inside the Node.js server process. React fixed it on December 3, 2025 in 19.0.1, 19.1.2 and 19.2.1 (react.dev advisory). The Next.js advisory lists the patched release for each line; App Router apps on Next.js 15 and 16 are affected, while Pages Router apps and Next.js 13 and 14 stable are not. CISA added the flaw to CISA KEV, its known exploited vulnerability catalog, on December 5, 2025.


CloudSEK recovered the attacker's 1.9-million-line exfiltration log and a toolkit of more than 900,000 files. BleepingComputer reports the run lasted from November 9 to 19. On each server, the toolkit read every environment variable, .env file, cloud credential file, SSH key and Kubernetes service-account token, and asked the cloud metadata service for temporary credentials where no static key existed.


Then it used them. It opened live connections to victims' own databases, pulled full Git archives, searched whole GitHub organizations with stolen tokens, and dumped a secrets manager with one gateway credential. Stolen AI API keys were tested against about ten providers, and stolen cloud accounts paid for more scanning. For persistence, it appended its own SSH key to authorized_keys, so patching does not remove access.


CloudSEK does not name the crew or a country, and nothing ties this campaign to ransomware, though CISA records ransomware use of the flaw itself.


Why this matters for MSPs and small businesses


The server was never the prize. The .env file was. A small business or agency shipping a Next.js site usually puts its AWS key, database password, payment key, AI key and GitHub token in the same environment variables. React2Keys read them in one pass, tested which still worked and ranked them by value. CloudSEK says victims include small-business infrastructure, with no sector focus.


So this is credential theft first and a web bug second. A copied key works until you rotate it, and good secrets management did not help victims whose vault credential sat in the app's environment. For web agencies, client sites that share a host or cloud account share a blast radius, which makes this an MSP security problem and a cloud security problem, not a developer chore. A site launched last week is not safe either.


What to do today


Patch React to 19.0.1, 19.1.2 or 19.2.1 and move Next.js to the patched release for your line. Treat any app that was online and unpatched after December 4, 2025 as having handed over its keys; the Next.js team tells those users to rotate secrets too. Rotate every secret that server can read: cloud, AI, database, registrar, payment and messaging keys, and any secrets-manager gateway credential. Start with cloud and payment keys.


Remove every SSH key nobody can name from every authorized_keys file, and check cron jobs and SSH logins. On each Linux web host, awk -F: '{print $6"/.ssh"}' /etc/passwd | xargs grep -rnsF -e AAAAC3NzaC1lZDI1NTE5AAAAINiNfAw552VRo+E3mBu/MHaVsRDcN0BMGuVCjgIyHbb3 -e bluelocale-foothold finds CloudSEK's only published indicator.


Indicator

Type

CloudSEK context

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINiNfAw552VRo+E3mBu/MHaVsRDcN0BMGuVCjgIyHbb3

SSH public key

Attacker key appended to authorized_keys, comment "bluelocale-foothold"

SHA256:ztvMBdTBkscWekLRs1764lnZC+PI4rcvME6tjQnqFok

SSH key fingerprint

Computed from the key above; appears in sshd "Accepted publickey" log lines


Review EKS Pod Identity, IRSA and Azure managed identities. Require IMDSv2 with a hop limit of 1 on EC2 hosts that run containers, set spend alerts on every AI account including Amazon Bedrock, give each app its own cloud identity, run apps as non-root, and stop sharing hosts across apps.


How to hunt


Hunt host behavior from December 4, 2025 and CloudTrail from November 1, 2026. This threat hunting reads EDR, Linux auth logs and AWS CloudTrail; every window fits a typical small environment. On Azure and GCP, apply Hunt 3 to managed-identity sign-ins and service-account key use.


Test 1: which servers run Next.js in production


Purpose: every host running Next.js under node, plus listed web hosts silent for a day.


Splunk


| tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen values(Processes.process) as command_lines values(Processes.user) as users from datamodel=Endpoint.Processes where earliest="12/04/2025:00:00:00" Processes.process_name="node" (Processes.process="*next start*" OR Processes.process="*next-server*" OR Processes.process="*.next/standalone/server.js*" OR Processes.process="*next dev*" OR Processes.process="*next build*") by Processes.dest
| rename Processes.* as *
| eval prod=mvfilter(match(command_lines, "next start|next-server|\.next/standalone/server\.js"))
| eval role=if(mvcount(prod)>0, "1 production Next.js server", "3 build or developer machine")
| append [| tstats summariesonly=false count max(_time) as last_seen from datamodel=Endpoint.Processes where earliest="12/04/2025:00:00:00" Processes.dest IN ("YOUR_WEB_HOST_1", "YOUR_WEB_HOST_2") by Processes.dest
    | rename Processes.* as *
    | append [| makeresults | eval dest=split("YOUR_WEB_HOST_1,YOUR_WEB_HOST_2", ",") | mvexpand dest | eval count=0 | fields dest count]
    | stats sum(count) as count max(last_seen) as last_seen by dest
    | eval role=if(count=0 OR last_seen < relative_time(now(), "-1d"), "2 listed web host with no process events in the last day: not cleared", "4 listed web host with process events")]
| convert ctime(first_seen) ctime(last_seen)
| table role dest users command_lines count first_seen last_seen
| sort role dest

Elastic


FROM YOUR_ENDPOINT_INDEX
| WHERE @timestamp >= TO_DATETIME("2025-12-04T00:00:00Z") AND event.category == "process" AND host.os.type == "linux"
| EVAL cmd = TO_LOWER(process.command_line),
    prod = process.name == "node" AND (cmd LIKE "*next start*" OR cmd LIKE "*next-server*" OR cmd LIKE "*.next/standalone/server.js*"),
    dev = process.name == "node" AND (cmd LIKE "*next dev*" OR cmd LIKE "*next build*"),
    listed = host.name IN ("YOUR_WEB_HOST_1", "YOUR_WEB_HOST_2")
| WHERE prod OR dev OR listed
| STATS prod_events = COUNT(*) WHERE prod, dev_events = COUNT(*) WHERE dev,
    first_seen = MIN(@timestamp) WHERE prod OR dev, last_seen = MAX(@timestamp) WHERE prod OR dev, last_event = MAX(@timestamp),
    users = VALUES(user.name) WHERE prod OR dev, command_lines = VALUES(process.command_line) WHERE prod OR dev BY host.name
| EVAL role = CASE(prod_events > 0, "1 production Next.js server",
    host.name IN ("YOUR_WEB_HOST_1", "YOUR_WEB_HOST_2") AND last_event < NOW() - 1 day, "2 listed web host with no process events in the last day: not cleared",
    dev_events > 0, "3 build or developer machine",
    "4 listed web host with process events")
| SORT role, host.name

CrowdStrike


// Time picker: Dec 4, 2025 to now. Needs the Falcon sensor on Linux web hosts.
// YOUR_WEB_HOST_1 and YOUR_WEB_HOST_2 name your internet-facing web servers.
#event_simpleName=ProcessRollup2 event_platform=Lin
| cmd := lower(CommandLine)
| case {
    FileName="node" | cmd=/next start|next-server|\.next\/standalone\/server\.js/ | role := "1 production Next.js server" ;
    FileName="node" | cmd=/next (dev|build)/ | role := "3 build or developer machine" ;
    in(field=ComputerName, values=["YOUR_WEB_HOST_1", "YOUR_WEB_HOST_2"], ignoreCase=true) | role := "4 listed web host with process events" }
| groupBy([ComputerName, role], function=[count(as=events), min(@timestamp, as=first_seen), max(@timestamp, as=last_seen), collect([UserName, CommandLine])], limit=max)
| case { role=/^4/ | test(last_seen < now() - 86400000) | role := "2 listed web host with no process events in the last day: not cleared" ; * }
| sort([role, ComputerName], order=asc, limit=10000)

Microsoft KQL


// Defender keeps 30 days of its own data; streamed to Sentinel, these tables follow your Sentinel retention back toward Dec 4, 2025.
let start = datetime(2025-12-04);
let webHosts = dynamic(["YOUR_WEB_HOST_1", "YOUR_WEB_HOST_2"]);
DeviceProcessEvents
| where Timestamp >= start
| extend Cmd = tolower(ProcessCommandLine)
| extend Role = case(FileName == "node" and Cmd matches regex @"next start|next-server|\.next/standalone/server\.js", "1 production Next.js server",
    FileName == "node" and Cmd matches regex @"next (dev|build)", "3 build or developer machine",
    DeviceName in~ (webHosts), "4 listed web host with process events", "")
| where isnotempty(Role)
| summarize Events = count(), FirstSeen = min(Timestamp), LastSeen = max(Timestamp), Users = make_set(AccountName, 10), CommandLines = make_set(ProcessCommandLine, 10) by DeviceName, Role
| extend Role = iff(Role startswith "4" and LastSeen < ago(1d), "2 listed web host with no process events in the last day: not cleared", Role)
| order by Role asc, DeviceName asc

Field mapping: Splunk CIM Endpoint; Elastic ECS process fields; CrowdStrike ProcessRollup2; Microsoft Defender DeviceProcessEvents. A listed web host missing here sends no process events and is not cleared. False positives: build and developer machines run next build and next dev. Test 1 shows where Next.js runs, not which release, so read the next and react versions from each app's package-lock.json.


Hunt 1: the Node.js web server starting shells and downloaders


Purpose: node starting shells, downloaders, database clients or secret-naming commands, or calling the metadata service.


Splunk


| tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen values(Processes.process) as command_lines values(Processes.user) as users from datamodel=Endpoint.Processes where earliest="12/04/2025:00:00:00" Processes.parent_process_name="node" by Processes.dest Processes.process_name
| rename Processes.* as *
| eval secret_read=mvfilter(match(command_lines, "\.env|\.aws/credentials|\.ssh/|authorized_keys|169\.254\.169\.254|serviceaccount/token"))
| eval flag=case(mvcount(secret_read)>0, "1 node child naming secrets, SSH keys or the metadata service",
    in(process_name, "sh", "bash", "dash", "curl", "wget", "python", "python3", "pip", "ssh", "git", "psql", "redis-cli", "mongosh"), "2 node starting a shell, downloader or database client")
| where isnotnull(flag)
| append [| tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen from datamodel=Network_Traffic.All_Traffic where earliest="12/04/2025:00:00:00" All_Traffic.dest_ip="169.254.169.254" All_Traffic.src_ip IN ("YOUR_WEB_HOST_IP_1", "YOUR_WEB_HOST_IP_2") by All_Traffic.src_ip
    | rename All_Traffic.src_ip as dest
    | eval flag="2 web host calling the cloud metadata service"]
| convert ctime(first_seen) ctime(last_seen)
| table flag dest process_name users command_lines count first_seen last_seen
| sort flag dest

Elastic


FROM YOUR_ENDPOINT_INDEX
| WHERE @timestamp >= TO_DATETIME("2025-12-04T00:00:00Z") AND host.os.type == "linux"
    AND ((event.category == "process" AND process.parent.name == "node")
      OR (event.category == "network" AND process.name == "node" AND destination.ip == TO_IP("169.254.169.254")))
| EVAL cmd = TO_LOWER(process.command_line),
    flag = CASE(event.category == "network", "2 node calling the cloud metadata service",
      cmd RLIKE """.*(\.env|\.aws/credentials|\.ssh/|authorized_keys|169\.254\.169\.254|serviceaccount/token).*""", "1 node child naming secrets, SSH keys or the metadata service",
      process.name IN ("sh", "bash", "dash", "curl", "wget", "python", "python3", "pip", "ssh", "git", "psql", "redis-cli", "mongosh"), "2 node starting a shell, downloader or database client",
      NULL)
| WHERE flag IS NOT NULL
| STATS events = COUNT(*), first_seen = MIN(@timestamp), last_seen = MAX(@timestamp), children = VALUES(process.name),
    command_lines = VALUES(process.command_line), users = VALUES(user.name) BY flag, host.name
| SORT flag, host.name

CrowdStrike


// Time picker: Dec 4, 2025 to now. Needs the Falcon sensor on Linux web hosts.
// Metadata rows come from NetworkConnectIP4 on YOUR_WEB_HOST_1 and YOUR_WEB_HOST_2; ContextProcessId ties each one to its process.
#event_simpleName=/^(ProcessRollup2|NetworkConnectIP4)$/ event_platform=Lin
| case {
    #event_simpleName=NetworkConnectIP4 | RemoteAddressIP4="169.254.169.254" | in(field=ComputerName, values=["YOUR_WEB_HOST_1", "YOUR_WEB_HOST_2"], ignoreCase=true) | flag := "2 web host calling the cloud metadata service" ;
    #event_simpleName=ProcessRollup2 | ParentBaseFileName="node" | CommandLine=/\.env|\.aws\/credentials|\.ssh\/|authorized_keys|169\.254\.169\.254|serviceaccount\/token/i | flag := "1 node child naming secrets, SSH keys or the metadata service" ;
    #event_simpleName=ProcessRollup2 | ParentBaseFileName="node" | in(field=FileName, values=["sh", "bash", "dash", "curl", "wget", "python", "python3", "pip", "ssh", "git", "psql", "redis-cli", "mongosh"]) | flag := "2 node starting a shell, downloader or database client" }
| groupBy([flag, ComputerName], function=[count(as=events), min(@timestamp, as=first_seen), max(@timestamp, as=last_seen), collect([FileName, CommandLine, UserName, ContextProcessId])], limit=max)
| sort([flag, ComputerName], order=asc, limit=10000)

Microsoft KQL


// Defender keeps 30 days of its own data; streamed to Sentinel, these tables follow your Sentinel retention back toward Dec 4, 2025.
let start = datetime(2025-12-04);
let tools = dynamic(["sh", "bash", "dash", "curl", "wget", "python", "python3", "pip", "ssh", "git", "psql", "redis-cli", "mongosh"]);
let children = DeviceProcessEvents
    | where Timestamp >= start and InitiatingProcessFileName == "node"
    | extend Flag = case(ProcessCommandLine matches regex @"(?i)\.env|\.aws/credentials|\.ssh/|authorized_keys|169\.254\.169\.254|serviceaccount/token", "1 node child naming secrets, SSH keys or the metadata service",
        FileName in (tools), "2 node starting a shell, downloader or database client", "")
    | where isnotempty(Flag)
    | project Timestamp, DeviceName, Flag, Process = FileName, CommandLine = ProcessCommandLine, Account = AccountName;
let metadata = DeviceNetworkEvents
    | where Timestamp >= start and RemoteIP == "169.254.169.254" and InitiatingProcessFileName == "node"
    | project Timestamp, DeviceName, Flag = "2 node calling the cloud metadata service", Process = InitiatingProcessFileName, CommandLine = InitiatingProcessCommandLine, Account = InitiatingProcessAccountName;
union children, metadata
| summarize Events = count(), FirstSeen = min(Timestamp), LastSeen = max(Timestamp), Processes = make_set(Process, 20), CommandLines = make_set(CommandLine, 20), Accounts = make_set(Account, 10) by Flag, DeviceName
| order by Flag asc, DeviceName asc

Field mapping: Test 1 sources plus Splunk Network_Traffic, which has no process name, so that row is scoped to web hosts; NetworkConnectIP4; DeviceNetworkEvents. False positives: image tools shell out and AWS SDKs read the metadata service, so a new child or caller is the signal.


Hunt 2: the SSH key the attacker planted


Purpose: authorized_keys writes, and sshd logins with CloudSEK's key fingerprint.


Splunk


| tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen values(Filesystem.action) as actions values(Filesystem.file_path) as paths values(Filesystem.user) as users values(Filesystem.process_id) as pids from datamodel=Endpoint.Filesystem where earliest="12/04/2025:00:00:00" Filesystem.file_path="*/.ssh/authorized_keys" Filesystem.action IN ("created", "modified") by Filesystem.dest
| rename Filesystem.* as *
| eval flag="2 authorized_keys created or changed"
| append [ search index=YOUR_INDEX earliest="12/04/2025:00:00:00" "Accepted publickey" "SHA256:ztvMBdTBkscWekLRs1764lnZC+PI4rcvME6tjQnqFok"
    | stats count min(_time) as first_seen max(_time) as last_seen values(_raw) as lines by host
    | rename host as dest
    | eval flag="1 login with the CloudSEK React2Keys key (fingerprint match)" ]
| convert ctime(first_seen) ctime(last_seen)
| table flag dest paths actions users pids lines count first_seen last_seen
| sort flag dest

Elastic


FROM YOUR_ENDPOINT_INDEX, logs-system.auth-*
| WHERE @timestamp >= TO_DATETIME("2025-12-04T00:00:00Z")
    AND ((event.category == "file" AND file.path LIKE "*/.ssh/authorized_keys")
      OR (system.auth.ssh.event == "Accepted" AND system.auth.ssh.method == "publickey" AND system.auth.ssh.signature LIKE "*SHA256:ztvMBdTBkscWekLRs1764lnZC+PI4rcvME6tjQnqFok*"))
| EVAL flag = CASE(system.auth.ssh.signature LIKE "*SHA256:ztvMBdTBkscWekLRs1764lnZC+PI4rcvME6tjQnqFok*", "1 login with the CloudSEK React2Keys key (fingerprint match)",
    "2 authorized_keys file activity")
| STATS events = COUNT(*), first_seen = MIN(@timestamp), last_seen = MAX(@timestamp), paths = VALUES(file.path), processes = VALUES(process.name),
    users = VALUES(user.name), sources = VALUES(source.ip), actions = VALUES(event.action) BY flag, host.name
| SORT flag, host.name

CrowdStrike


// Time picker: Dec 4, 2025 to now. File rows need a FileVantage policy on ~/.ssh paths; login rows need Linux auth logs (sshd) in Falcon Next-Gen SIEM.
#event_simpleName=/^FileIntegrityMonitorRuleMatched/ or #event_simpleName=/FileWritten$/ or "SHA256:ztvMBdTBkscWekLRs1764lnZC+PI4rcvME6tjQnqFok"
| case {
    @rawstring=/Accepted publickey.*SHA256:ztvMBdTBkscWekLRs1764lnZC\+PI4rcvME6tjQnqFok/ | flag := "1 login with the CloudSEK React2Keys key (fingerprint match)" ;
    #event_simpleName=/^FileIntegrityMonitorRuleMatched/ | ObjectAccessOperationType!=3 | ObjectName=/\/\.ssh\/authorized_keys$/ | flag := "2 authorized_keys created or changed" ;
    #event_simpleName=/^FileIntegrityMonitorRuleMatched/ | ObjectNameNew=/\/\.ssh\/authorized_keys$/ | flag := "2 authorized_keys created or changed" ;
    TargetFileName=/\/\.ssh\/authorized_keys$/ | flag := "2 authorized_keys created or changed" }
| case { ComputerName=* | host := ComputerName ; host.name=* | host := host.name ; * | host := "unknown" }
| groupBy([flag, host], function=[count(as=events), min(@timestamp, as=first_seen), max(@timestamp, as=last_seen), collect([ObjectName, ObjectNameNew, TargetFileName, ImageFileName, UserName, ObjectAccessOperationType, @rawstring])], limit=max)
| sort([flag, host], order=asc, limit=10000)

Microsoft KQL


// Runs in Sentinel with Defender XDR tables streamed, or in the unified Defender portal; Defender alone keeps 30 days.
let start = datetime(2025-12-04);
let fingerprint = "SHA256:ztvMBdTBkscWekLRs1764lnZC+PI4rcvME6tjQnqFok";
let logins = Syslog
    | where TimeGenerated >= start and ProcessName in ("sshd", "sshd-session") and SyslogMessage has "Accepted publickey" and SyslogMessage contains fingerprint
    | summarize Events = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), Lines = make_set(SyslogMessage, 20) by Host = HostName
    | extend Flag = "1 login with the CloudSEK React2Keys key (fingerprint match)";
let writes = DeviceFileEvents
    | where Timestamp >= start and FileName == "authorized_keys" and (FolderPath endswith "/.ssh" or FolderPath endswith "/.ssh/authorized_keys") and ActionType in ("FileCreated", "FileModified", "FileRenamed")
    | summarize Events = count(), FirstSeen = min(Timestamp), LastSeen = max(Timestamp), Paths = make_set(FolderPath, 20), Writers = make_set(InitiatingProcessFileName, 20), Actions = make_set(ActionType, 5) by Host = DeviceName
    | extend Flag = "2 authorized_keys created or changed";
union logins, writes
| order by Flag asc, Host asc

Field mapping: Splunk Endpoint Filesystem plus raw auth logs; Elastic System integration ssh fields; CrowdStrike FileVantage; Sentinel Syslog. False positives: admins and configuration management edit authorized_keys; a write by node or curl is the signal, and the fingerprint has none.


Hunt 3: your cloud keys used from somewhere new


Purpose: app keys and roles used outside your hosting ranges, Bedrock use, and new users, keys, instances or functions.


Splunk


index=YOUR_CLOUDTRAIL_INDEX sourcetype=aws:cloudtrail earliest="11/01/2026:00:00:00"
| rename userIdentity.accessKeyId as key_id, userIdentity.arn as arn
| where in(key_id, "YOUR_APP_KEY_ID_1", "YOUR_APP_KEY_ID_2") OR like(arn, "%:assumed-role/YOUR_APP_ROLE_NAME/%")
| eval outside=if(NOT match(sourceIPAddress, "^[0-9a-fA-F.:]+$") OR cidrmatch("YOUR_HOSTING_CIDR_1", sourceIPAddress) OR cidrmatch("YOUR_HOSTING_CIDR_2", sourceIPAddress), 0, 1)
| eval flag=case(eventName=="PutUseCaseForModelAccess", "1 app identity tried to submit a Bedrock use-case form",
    in(eventName, "CreateUser", "CreateAccessKey", "RunInstances") OR like(eventName, "CreateFunction%"), "1 app identity tried to create a user, key, instance or Lambda function",
    eventName=="GetCallerIdentity" AND outside==1, "1 key check (GetCallerIdentity) from outside your hosting ranges",
    eventSource=="bedrock.amazonaws.com", "2 Bedrock call by an app identity",
    outside==1, "2 app identity used from outside your hosting ranges")
| where isnotnull(flag)
| stats count min(_time) as first_seen max(_time) as last_seen values(sourceIPAddress) as source_ips values(eventName) as events values(userAgent) as agents values(errorCode) as errors by flag arn key_id
| convert ctime(first_seen) ctime(last_seen)
| sort flag -count

Elastic


FROM logs-aws.cloudtrail-*
| WHERE @timestamp >= TO_DATETIME("2026-11-01T00:00:00Z")
    AND (aws.cloudtrail.user_identity.access_key_id IN ("YOUR_APP_KEY_ID_1", "YOUR_APP_KEY_ID_2")
      OR aws.cloudtrail.user_identity.arn LIKE "*:assumed-role/YOUR_APP_ROLE_NAME/*")
| EVAL outside = source.ip IS NOT NULL AND NOT CIDR_MATCH(source.ip, "YOUR_HOSTING_CIDR_1", "YOUR_HOSTING_CIDR_2"),
    flag = CASE(event.action == "PutUseCaseForModelAccess", "1 app identity tried to submit a Bedrock use-case form",
      event.action IN ("CreateUser", "CreateAccessKey", "RunInstances") OR event.action LIKE "CreateFunction*", "1 app identity tried to create a user, key, instance or Lambda function",
      event.action == "GetCallerIdentity" AND outside, "1 key check (GetCallerIdentity) from outside your hosting ranges",
      event.provider == "bedrock.amazonaws.com", "2 Bedrock call by an app identity",
      outside, "2 app identity used from outside your hosting ranges",
      NULL)
| WHERE flag IS NOT NULL
| STATS events = COUNT(*), first_seen = MIN(@timestamp), last_seen = MAX(@timestamp), source_ips = VALUES(source.ip), actions = VALUES(event.action),
    agents = VALUES(user_agent.original), errors = VALUES(aws.cloudtrail.error_code)
    BY flag, aws.cloudtrail.user_identity.arn, aws.cloudtrail.user_identity.access_key_id
| SORT flag, events DESC

CrowdStrike


// Time picker: Nov 1, 2026 to now. Needs AWS CloudTrail in Falcon Next-Gen SIEM through the CPS parser, which keeps CloudTrail userIdentity under Vendor.userIdentity.
// #Vendor and #event.module are the tags the aws-cloudtrail parser writes; the caller IP stays in Vendor.sourceIPAddress.
#Vendor="aws" #event.module="cloudtrail"
| case {
    in(field="Vendor.userIdentity.accessKeyId", values=["YOUR_APP_KEY_ID_1", "YOUR_APP_KEY_ID_2"]) | app := 1 ;
    Vendor.userIdentity.arn=/:assumed-role\/YOUR_APP_ROLE_NAME\// | app := 1 ;
    * | app := 0 }
| app=1
| case { Vendor.sourceIPAddress=/^[0-9a-fA-F.:]+$/ | !cidr(Vendor.sourceIPAddress, subnet=["YOUR_HOSTING_CIDR_1", "YOUR_HOSTING_CIDR_2"]) | outside := 1 ; * | outside := 0 }
| case {
    event.action="PutUseCaseForModelAccess" | flag := "1 app identity tried to submit a Bedrock use-case form" ;
    event.action=/^(CreateUser|CreateAccessKey|RunInstances)$|^CreateFunction/ | flag := "1 app identity tried to create a user, key, instance or Lambda function" ;
    event.action="GetCallerIdentity" | outside=1 | flag := "1 key check (GetCallerIdentity) from outside your hosting ranges" ;
    event.provider="bedrock.amazonaws.com" | flag := "2 Bedrock call by an app identity" ;
    outside=1 | flag := "2 app identity used from outside your hosting ranges" }
| groupBy([flag, Vendor.userIdentity.arn, Vendor.userIdentity.accessKeyId], function=[count(as=events), min(@timestamp, as=first_seen), max(@timestamp, as=last_seen), collect([Vendor.sourceIPAddress, event.action, user_agent.original, error.code])], limit=max)
| sort(flag, order=asc, limit=1000)

Microsoft KQL


let start = datetime(2026-11-01);
let appKeys = dynamic(["YOUR_APP_KEY_ID_1", "YOUR_APP_KEY_ID_2"]);
let appRole = ":assumed-role/YOUR_APP_ROLE_NAME/";
let hosting = dynamic(["YOUR_HOSTING_CIDR_1", "YOUR_HOSTING_CIDR_2"]);
AWSCloudTrail
| where TimeGenerated >= start
| where UserIdentityAccessKeyId in (appKeys) or UserIdentityArn contains appRole
| extend Outside = isnotnull(parse_ipv6(SourceIpAddress)) and (isnull(parse_ipv4(SourceIpAddress)) or not(ipv4_is_in_any_range(SourceIpAddress, hosting)))
| extend Flag = case(EventName == "PutUseCaseForModelAccess", "1 app identity tried to submit a Bedrock use-case form",
    EventName in ("CreateUser", "CreateAccessKey", "RunInstances") or EventName startswith "CreateFunction", "1 app identity tried to create a user, key, instance or Lambda function",
    EventName == "GetCallerIdentity" and Outside, "1 key check (GetCallerIdentity) from outside your hosting ranges",
    EventSource == "bedrock.amazonaws.com", "2 Bedrock call by an app identity",
    Outside, "2 app identity used from outside your hosting ranges", "")
| where isnotempty(Flag)
| summarize Events = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated), SourceIps = make_set(SourceIpAddress, 20), Actions = make_set(EventName, 20),
    Agents = make_set(UserAgent, 10), Errors = make_set(ErrorCode, 10) by Flag, UserIdentityArn, UserIdentityAccessKeyId
| order by Flag asc, Events desc

Field mapping: Splunk Add-on for AWS; Elastic CloudTrail integration; CrowdStrike CPS; Sentinel AWSCloudTrail. Match roles by name, since metadata credentials rotate key IDs. False positives: CI jobs and developers reusing an app key show up too, and that is itself a finding.


Reading the results before you escalate


A production host in Test 1 that ran an affected release after December 4, 2025 has handed over its secrets: rotate them and run Hunts 1 to 3 for it. A host marked not cleared needs telemetry before anyone calls it clean. A new Hunt 1 hit means compromise: snapshot, rotate and rebuild from a clean image. A fingerprint login in Hunt 2 is a confirmed foothold: remove the key, rebuild, and check every host sharing those SSH keys, since CloudSEK found a lateral-movement list. An authorized_keys write is a lead until the grep in What to do today finds the key or Hunt 2 shows node wrote it, and a host with no file or sshd events still needs that grep. A Hunt 3 hit means the cloud account is compromised: rotate keys, delete what you did not create, and check billing, AI usage, GitHub and secrets-manager logs. Clean results still mean rotating, because reading environment variables leaves no trace.


One next step


List every key in your production .env files today and rotate the ones on any server that ran an affected Next.js release, cloud and payment keys first. The app was the door, the environment file was the key ring, and patching only closes the door. For the Microsoft 365 side of identity risk, start with a free Inception Foresight M365 Assessment at inceptionsecurity.com/m365assessment.


Follow us on LinkedIn (Inception Security) and X (@inceptionsec).


bg-map-white.png

INCEPTION SECURITY™

A cybersecurity company with in depth knowledge of the threat landscape and security controls.

NAVIGATION

GET IN TOUCH

© 2025 All Rights Reserved by INCEPTION SECURITY™ .

bottom of page