Back to Intelligence

SAP Security Incident: Stolen GitHub Tokens and Source Code Tampering — Defending Your Software Supply Chain

SA
Security Arsenal Team
November 28, 2026
11 min read

SAP has confirmed a security incident after detecting suspicious activity in its IT systems. According to reporting by DER SPIEGEL, attackers stole GitHub access tokens and altered source code — a combination that should alarm every organization that builds, integrates, or consumes enterprise software. SAP has not confirmed a data breach, and notably, most of the public detail is coming from the press rather than the vendor. That information gap is itself a risk signal: when a company the size of SAP loses control of developer credentials and can't immediately rule out source code integrity issues, every downstream consumer of SAP software is in the blast radius.

This is not a drill scenario. Token theft followed by source code modification is the classic precursor to a supply chain compromise — the same playbook that turned SolarWinds and the Codecov breach into industry-defining events. If attackers can push malicious commits using a legitimate developer token, those changes ride trusted update channels straight into customer environments. Defenders need to act on two fronts simultaneously: assume the incident is worse than currently disclosed, and audit your own exposure to the exact techniques involved — because if it happened to SAP, your developer credentials are being targeted too.

Technical Analysis

What We Know

Based on SAP's confirmation and press reporting:

  • Attackers obtained GitHub access tokens — authentication credentials that grant programmatic access to source code repositories, CI/CD workflows, and in many cases the ability to push commits, modify releases, or alter Actions/Pipeline definitions.
  • Source code was altered — the most consequential element. Whether this was reconnaissance-level probing or insertion of malicious code is not yet public. Both possibilities demand the same defensive posture.
  • No confirmed data breach yet — but "unconfirmed" is not "ruled out." Enterprise vendor breaches routinely evolve over weeks as forensic scope expands.

Why GitHub Token Theft Is So Dangerous

Personal Access Tokens (PATs), OAuth tokens, and fine-grained tokens are the connective tissue of modern development. They authenticate developers, service accounts, CI runners, and third-party integrations. Critically:

  • Tokens bypass MFA. A stolen PAT works from anywhere in the world with no second factor. This is why token theft has become a preferred initial access and persistence technique (MITRE ATT&CK T1528 — Steal Application Access Token, and T1552.001 — Credentials In Files).
  • Tokens over-privilege by default. Classic PATs frequently carry repo, workflow, and admin:org scopes far beyond what the user or automation actually needs.
  • Token use blends in. API calls and git operations authenticated with a developer's token are logged as that developer. Malicious commits look legitimate unless you're auditing author/committer mismatches, push geography, and commit signing.

The source code alteration component maps to T1195.001 (Compromise Software Dependencies and Development Tools) and T1078 (Valid Accounts). If the attackers modified code that ships in SAP products or is consumed by SAP's build pipeline, the downstream impact could mirror a classic build-system compromise — malicious artifacts signed and distributed as trusted updates.

Exploitation Status

This is a confirmed incident with confirmed token theft and source code modification, per vendor acknowledgment and investigative reporting. There is no CVE associated with this incident — it is a credential-theft and integrity compromise, not a product vulnerability. There is no CISA KEV entry because there is no patchable bug; the remediation is credential hygiene, repository integrity verification, and supply chain monitoring. Treat the full scope as unknown and expanding until SAP publishes a completed forensic report.

Detection & Response

The detections below target the three observable behaviors in this incident: (1) token/credential theft from developer endpoints, (2) anomalous git and GitHub API activity consistent with token replay, and (3) signs of source code tampering. Tune them to your environment — legitimate developers clone repos constantly, so the signal is in the anomalies: unusual hosts, unusual hours, unsigned commits, and tokens used from infrastructure that has never touched your VCS before.

Sigma Rules

YAML
---
title: Git Credential File Access by Non-Git Process
id: 3f8a2b91-7c4e-4d1a-9b6f-2e5c8a1d4f90
status: experimental
description: Detects processes other than git/credential helpers reading stored Git credentials, consistent with token theft from developer workstations as reported in the SAP incident.
references:
  - https://attack.mitre.org/techniques/T1552/001/
  - https://attack.mitre.org/techniques/T1528/
author: Security Arsenal
date: 2026/01/20
tags:
  - attack.credential_access
  - attack.t1552.001
  - attack.t1528
logsource:
  category: file_event
  product: windows
detection:
  selection_path:
    TargetFilename|contains:
      - '\.git-credentials'
      - '\.gitconfig'
      - '\.config\gh\hosts.yml'
      - '\AppData\Roaming\GitHub Desktop\'
      - '\.ssh\id_'
  filter_legitimate:
    Image|endswith:
      - '\git.exe'
      - '\git-credential-manager.exe'
      - '\GitHubDesktop.exe'
      - '\gh.exe'
      - '\Code.exe'
  condition: selection_path and not filter_legitimate
falsepositives:
  - Backup and sync agents reading user profile directories
  - EDR/DLP scanners performing content inspection
level: high
---
title: Git Clone or Fetch by Unusual Parent Process
id: 8c1d4e72-3b5a-4f09-a2c7-9d1e6b8f3a21
status: experimental
description: Detects git operations spawned by scripting engines or office applications, indicating token replay or automated repository exfiltration using stolen developer credentials.
references:
  - https://attack.mitre.org/techniques/T1213/
  - https://attack.mitre.org/techniques/T1552/001/
author: Security Arsenal
date: 2026/01/20
tags:
  - attack.collection
  - attack.credential_access
logsource:
  category: process_creation
  product: windows
detection:
  selection_img:
    Image|endswith:
      - '\git.exe'
      - '\gh.exe'
  selection_cmd:
    CommandLine|contains:
      - ' clone '
      - ' archive'
      - ' bundle create'
      - 'api.github.com'
      - '/repos/'
  selection_parent:
    ParentImage|endswith:
      - '\powershell.exe'
      - '\pwsh.exe'
      - '\wscript.exe'
      - '\cscript.exe'
      - '\cmd.exe'
      - '\rundll32.exe'
  condition: selection_img and selection_cmd and selection_parent
falsepositives:
  - Legitimate automation and build scripts invoking git
  - Developer tooling wrappers
level: medium
---
title: Curl or Wget Access to GitHub API with Authorization Header
id: 5e2b7f14-9a3c-4d68-b1f4-7c8e2a5d9f63
status: experimental
description: Detects direct GitHub API access via command-line HTTP clients with embedded authorization tokens, a pattern associated with scripted token validation and repository enumeration after credential theft.
references:
  - https://attack.mitre.org/techniques/T1528/
  - https://attack.mitre.org/techniques/T1102/
author: Security Arsenal
date: 2026/01/20
tags:
  - attack.credential_access
  - attack.collection
logsource:
  category: process_creation
  product: windows
detection:
  selection_img:
    Image|endswith:
      - '\curl.exe'
      - '\wget.exe'
  selection_cmd:
    CommandLine|contains: 'api.github.com'
  selection_token:
    CommandLine|contains:
      - 'Authorization'
      - 'token ghp_'
      - 'token github_pat_'
      - 'Bearer gho_'
  condition: selection_img and selection_cmd and selection_token
falsepositives:
  - Developer scripts and CI jobs querying the GitHub API
level: high

KQL Hunt — Anomalous Git Activity and Token Replay

This query hunts for git and GitHub CLI executions on endpoints with characteristics consistent with stolen-token replay: new hosts running repo enumeration, embedded tokens on the command line, or mass archive/bundle operations. Run it against Defender for Endpoint data; if you ingest GitHub audit logs into Sentinel, join against GitHubAudit (or your custom table) on actor IP to flag tokens used from previously unseen geographies.

KQL — Microsoft Sentinel / Defender
let Lookback = 14d;
let KnownGitHosts = DeviceProcessEvents
    | where TimeGenerated > ago(90d) and TimeGenerated < ago(Lookback)
    | where FileName in~ ('git.exe','gh.exe','git-remote-https.exe')
    | summarize by DeviceName;
DeviceProcessEvents
| where TimeGenerated > ago(Lookback)
| where FileName in~ ('git.exe','gh.exe','curl.exe','wget.exe','git-remote-https.exe')
| where ProcessCommandLine has_any ('clone','bundle create','archive','api.github.com','/repos/','ghp_','github_pat_','Authorization')
| extend SuspiciousNewHost = iff(DeviceName !in (KnownGitHosts), true, false)
| extend EmbeddedToken = iff(ProcessCommandLine has_any ('ghp_','github_pat_','gho_','Authorization: token','Bearer ghp'), true, false)
| extend SuspiciousScore = toint(SuspiciousNewHost) + toint(EmbeddedToken) * 2
| project TimeGenerated, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, SuspiciousNewHost, EmbeddedToken, SuspiciousScore, RemoteIP
| order by SuspiciousScore desc, TimeGenerated desc

Velociraptor VQL — Hunt for Stored Git Credentials and Unsigned Commit Indicators

This artifact enumerates developer credential stores across endpoints (git credential files, GitHub CLI token files, SSH private keys) to identify where tokens could be harvested — essential scoping data if you suspect an intrusion similar to the SAP incident in your own environment.

VQL — Velociraptor
-- Hunt for stored Git/GitHub credentials accessible on endpoints (token theft surface)
LET cred_paths = SELECT FullPath, Size, Mtime
  FROM glob(globs=[
    'C:/Users/*/.git-credentials',
    'C:/Users/*/.config/gh/hosts.yml',
    'C:/Users/*/.ssh/id_*',
    'C:/Users/*/AppData/Local/GitCredentialManager/*',
    '/home/*/.git-credentials',
    '/home/*/.config/gh/hosts.yml',
    '/home/*/.ssh/id_*',
    '/root/.git-credentials'
  ])

LET suspicious_procs = SELECT Pid, Name, Exe, CommandLine, Username, CreateTime
  FROM pslist()
  WHERE CommandLine =~ '(?i)(git clone|git bundle|api\\.github\\.com|ghp_|github_pat_)'
     OR Name =~ '(?i)^(git-remote-https|gh)$'

SELECT * FROM cred_paths
UNION ALL
SELECT Exe AS FullPath, NULL AS Size, CreateTime AS Mtime FROM suspicious_procs

Remediation & Verification Script

Run this on developer workstations and build agents to identify stored credentials that require rotation and to verify repository integrity after a suspected token compromise. The git verification portion checks for unsigned or unexpected commits in the recent history — your primary signal for source code tampering.

Bash / Shell
#!/bin/bash
# git-token-hygiene-audit.sh — Identify stored GitHub credentials and audit repo integrity
# Run on developer workstations and CI/CD build agents

echo "=== [1] Stored GitHub/Git credentials on disk (ROTATE ALL FOUND) ==="
for f in ~/.git-credentials ~/.config/gh/hosts.yml ~/.netrc; do
  if [ -f "$f" ]; then
    echo "[!] CREDENTIAL FILE FOUND: $f (perms: $(stat -c '%a' "$f" 2>/dev/null || stat -f '%Lp' "$f"))"
  fi
done
find /home /root -maxdepth 3 -name '.git-credentials' -o -name 'hosts.yml' -path '*gh*' 2>/dev/null | while read -r f; do
  echo "[!] CREDENTIAL FILE FOUND: $f"
done

echo "=== [2] Credential helpers in use (store = plaintext on disk) ==="
git config --global --get credential.helper 2>/dev/null | while read -r h; do
  echo "[i] Global credential.helper: $h"
  [ "$h" = "store" ] && echo "[!] WARNING: 'store' helper saves tokens in PLAINTEXT. Migrate to a manager (libsecret/osxkeychain) or SSO."
done

echo "=== [3] Repo integrity: last 50 commits — author/committer mismatches and unsigned commits ==="
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
  git log -50 --pretty=format:'%h | author:%an <%ae> | committer:%cn <%ce> | signed:%G? | %ad | %s' --date=iso | \
  awk -F'|' '{ mismatch=($2!=$3) ? " [MISMATCH author/committer]" : ""; unsigned=($4 ~ /signed:N/) ? " [UNSIGNED]" : ""; print $0 mismatch unsigned }'
  echo ""
  echo "=== [4] Recent force pushes or branch resets in reflog ==="
  git reflog --date=iso | head -30 | grep -iE 'reset|forced' || echo "[i] No reset/force entries in local reflog."
else
  echo "[i] Not inside a git repository; skipping commit audit. Run per-repo."
fi

echo "=== [5] Processes currently holding GitHub tokens on the command line ==="
ps -eo pid,user,args | grep -iE 'ghp_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9_]{60,}|api\.github\.com' | grep -v grep || echo "[i] None found."

echo ""
echo "ACTIONS: (1) Revoke and rotate ALL tokens found above at https://github.com/settings/tokens"
echo "         (2) Audit PAT usage: GitHub org Settings > Audit log > filter on token usage and IP"
echo "         (3) Enforce commit signing (GPG/Sigstore) and branch protection with required reviews"

Remediation

Whether or not you're an SAP customer, this incident is a forcing function for developer credential hygiene. Prioritize in this order:

If you are an SAP customer (downstream supply chain risk):

  1. Monitor SAP's official channels — the SAP Trust Center (https://www.sap.com/about/trust-center.html) and SAP Security Notes portal — for a formal incident advisory. Do not rely on press coverage for scope.
  2. Inventory your SAP exposure: which products, support connections (SAProuter, Solution Manager, S/4HANA integrations), and update mechanisms touch your environment. Update channels are the delivery mechanism in a supply chain scenario.
  3. Increase monitoring on SAP-facing infrastructure: Solution Manager in particular is a high-value, historically under-monitored pivot point. Watch for unexpected transports, new RFC destinations, and configuration changes until SAP confirms product integrity.
  4. Request written assurance through your account team regarding source code integrity verification and whether customer-facing artifacts were affected.

If you develop software (the token theft lesson — this means everyone):

  1. Rotate and right-size tokens now. Migrate from classic PATs to fine-grained tokens with minimum scopes, short expirations, and IP allowlisting where supported. Audit at https://github.com/settings/tokens and org-level Settings → Third-party access / Audit log.
  2. Eliminate plaintext token storage. Ban the store credential helper; use OS-backed credential managers. Scan endpoints and repos for committed secrets (gitleaks, trufflehog, GitHub secret scanning with push protection).
  3. Require commit signing and branch protection. GPG or Sigstore signing with vigilant mode, required reviews, and status checks make unauthorized pushes visible and blockable. This is the single strongest control against the "altered source code" scenario.
  4. Alert on token replay anomalies. GitHub's audit log captures token authentication events with IP and user agent. Alert on: token use from new ASN/geography, single token authenticating across multiple source IPs, and API enumeration patterns (/repos listing followed by archive downloads).
  5. Harden CI/CD. OIDC-based workload identity (e.g., GitHub Actions OIDC to cloud providers) eliminates long-lived secrets in pipelines. Restrict GITHUB_TOKEN permissions to least privilege per workflow.

There is no patch and no CISA KEV deadline — this is a credential compromise, not a CVE. Your deadline is self-imposed: stolen tokens are typically used within hours to days of theft. If your own telemetry shows any of the behaviors above, treat it as an active incident: revoke first, investigate second.

The SAP incident is a reminder that developer infrastructure is now a tier-one target. The organizations that weather these events are the ones that can answer three questions in under an hour: Which tokens exist? Where are they stored? What did they do in the last 30 days? If you can't answer those today, that's your remediation backlog.

Related Resources

Security Arsenal Managed SOC Services AlertMonitor Platform Book a SOC Assessment soc-mdr Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.