⚡Megatron LLM Hub
All digests
Website

rss-website

Top3

未授权 RCE 可窃取进程内令牌,紧急补丁已发,暴露的 PHP 站点全部受影响。

PHP2Shell (CVE-2026-109618 and CVE-2026-109619): The PHP Vulnerabilities Security Teams Should Patch Now By: Cymulate Research Lab October 22, 2026 PHP2Shell is a family of memory-safety bugs in PHP, tracked as CVE-2026-109618 and CVE-2026-109619 and rated CVSS 9.2 . The PHP Foundation shipped an emergency fix on October 21, 2026. The flaws allow an unauthenticated attacker to execute code as the PHP web worker or read its process memory, including passwords, tokens, and API keys from other users' requests. The flaws sit in PHP itself, so the exposure reaches beyond any single application such as WordPress, Drupal or Joomla. Wiz Research demonstrated pre-authentication remote code execution against all three, and even a simple PHP application can be exposed on a vulnerable deployment. At least one of the flaws affects PHP versions dating back more than a decade, and PHP powers an estimated 70% of websites. Below, we break down how the flaws work, what to patch and how to test your defenses with the PHP2Shell scenarios we've already added to Cymulate Exposure Validation. How Does the PHP2Shell Exploit Work? Both CVEs involve PHP continuing to use an invalid internal state after a request fails. CVE-2026-109618 concerns out-of-memory handling that can leave request memory partially initialized before cleanup. CVE-2026-109619 concerns a request-owned state that can survive into a later request on the same worker. Session upload progress is one confirmed path for the latter flaw, not a universal trigger for both CVEs. Some attack paths run before application code, so application-level authentication and logs may miss important evidence. Successful exploitation can disclose PHP worker memory or execute code with the worker's privileges. Exploitation attempts have already started. ELLIO recorded PHP2Shell traffic on October 21, including requests that tried to deliver a Mirai-variant Linux payload. So far, those observations indicate attempted exploitation and payload delivery, with no confirmed compromise of victims. How to Patch PHP2Shell Update affected PHP runtimes to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 , or install a vendor package with the relevant backported fixes. Restart the PHP workers that serve requests. PHP 8.1 and earlier are no longer supported upstream, although some vendors provide backports. Confirm the status of those installations with the vendor or move to a supported branch. If you cannot update immediately, follow the PHP project's path-specific guidance: controls for out-of-memory handling and request size can reduce exposure to CVE-2026-109618, while disabling session upload progress and restarting workers blocks one confirmed CVE-2026-109619 path. PHP 8.5 has a separate fatal-error-backtrace setting to consider. Web application firewall (WAF) rules and request limits can add protection, but each has coverage limits. Updating PHP is the only complete mitigation. Vulnerability details php2shell.com : Researcher summary and mitigation guide Wiz Research on PHP2Shell : Technical root cause CVE-2026-109618 / CVE-2026-109619 : MITRE ELLIO Threat Research Lab: PHP2Shell observations and Mirai-variant payload Patching resources PHP Foundation security release, October 21, 2026 AWS: Using AWS WAF to apply mitigations for PHP2Shell How to Test Your Defenses Against PHP2Shell With Cymulate Our research team tracks new threats as they emerge and turns them into tests you can run right away, so you're ready for PHP2Shell and whatever comes next. Cymulate Exposure Validation includes four PHP2Shell attack-pattern scenarios for testing how controls handle each simulated request or traffic replay: 1. Web Application Firewall CVE-2026-109618 - PHP Upload-Progress Attack Pattern (php2shell) CVE-2026-109619 -PHP Fatal-Error-Backtrace Attack Pattern (php2shell) These simulate multipart request patterns associated with the CVEs against protected sites. Compare the WAF verdict and its logs before and after rule tuning. Each result shows how the control handled that specific simulation, so run every scenario that applies to your environment. 2. Traffic Simulation (Advanced Scenarios, IPS/IDS) Traffic Simulation - CVE-2026-109618 - PHP Upload-Progress Attack Pattern (php2shell) Traffic Simulation - CVE-2026-109619 - PHP Fatal-Error-Backtrace Attack Pattern (php2shell) Cymulate threat feed campaigns for traffic simulation. These replay PHP2Shell-associated traffic between Cymulate agents to assess whether intrusion prevention and detection system (IPS/IDS) controls detect or block the replayed packets. A traffic-simulation verdict does not establish whether the destination PHP runtime is exploitable or patched. The four scenarios are rated Critical, mapped to the MITRE ATT&CK® technique T1190 (Exploit Public-Facing Application), and tagged with their corresponding CVEs in the content catalog. Those labels do not, by themselves, establish complete coverage of exploits. 3. Advanced Scenario: PHP2Shell Scanner (CVE-2026-109618 & CVE-2026-109619) Enter one or more target URLs to check the PHP version advertised in HTTP response headers against the fixed releases. The scanner sends no exploit payload. A missing version returns an unknown result. An older advertised version is an exposure signal, not proof of exploitability, because vendor backports and inaccurate or hidden headers can change the answer. Confirm findings against the installed package and vendor advisory. 4. Threat feed campaign: PHP2Shell Exploitation Attempts Delivering a Mirai-Variant Payload Cymulate threat feed campaign for PHP2Shell Mirai-variant payload. We published this threat feed campaign based on ELLIO's October 21 observations of PHP2Shell exploitation attempts that carried a loader for a Mirai-variant Linux payload. Use it to test how your endpoint and web gateway controls handle the observed indicators and delivery path. Together, these tests give you a clear view of your PHP2Shell readiness in Cymulate Exposure Validation: the attack-pattern simulations show how your controls respond, the scanner flags servers that may still be exposed and the threat feed campaign tests your defenses against the delivery activity seen in the wild. From there, confirm patch status in your asset and vendor records, close any gaps with tuning or remediation and rerun the same tests to prove your defenses hold. Want to know how your controls can handle PHP2Shell? Book a demo to see Cymulate in action. Cymulate Research Lab Our highly experienced and diverse researchers are fluent in security intelligence practices, combining expertise in private security, military, and intelligence experience. Continuously examining the cyber-threat landscape, our experts deliver in-depth visibility into today’s threats and the actors behind them. More about Author Table of Contents How Does the PHP2Shell Exploit Work? How to Patch PHP2Shell Vulnerability details Patching resources How to Test Your Defenses Against PHP2Shell With Cymulate Cymulate Exposure Validation makes advanced security testing fast and easy. When it comes to building custom attack chains, it's all right in front of you in one place. Mike Humbert , Cybersecurity Engineer DARLING INGREDIENTS INC. Learn More Featured Resources View More Resources Solution Brief Threat Validation Cymulate continuously validates defenses, baselines posture, and strengthens resilience against evolving threats. Read More CUSTOMERS Large Industrial Company Aligns Threat Validation with Business Goals Discover how a leading industrial manufacturer in the Gulf region enhanced its cybersecurity by adopting Cymulate's platform after NSS Labs' Read Case Study E-book Security Validation Essentials Learn security validation essentials to uncover gaps, measure risk, and strengthen your overall security posture. Learn More GET A PERSONALIZED DEMO Ready to see Cymulate in action? Book a Demo

rcecve内存安全凭据泄露 @cymulate-blog source ↗

只要诱导用户访问恶意网页,即可窃取云凭据,绕过常规 CSRF 防护思路。

CVE-2026-85267: CloudShell WSSnatch By: Cymulate Research Lab October 22, 2026 How one-click and zero-click WebSocket attack vectors turned Google Cloud Shell into a tunnel for OAuth token theft. Elad Beber, Senior Security Researcher Ben Zamir, Security Researcher Ilan Kalendarov, Former Security Research Team Lead Executive Summary Cymulate Research identified a Cross-Site WebSocket Hijacking vulnerability in Google Cloud Shell that allowed a malicious website to steal an active user's OAuth access token through the browser. Tracked as CVE-2026-85267 , the vulnerability received a CVSS 4.0 score of 8.7 (High) from Google Cloud. The attack combined three failures: a cookie sent with cross-site connections, missing WebSocket Origin validation, and a TCP tunnel that exposed an internal token service. Together, they allowed an attacker-controlled page to use the victim's authenticated Cloud Shell session to retrieve a token. Two delivery scenarios were demonstrated: One-click, remote: an attacker who knew the victim's Cloud Shell editor hostname could trigger token theft when the victim opened a malicious page. Zero-click, same network: an attacker on the same Layer 2 network could discover the hostname through DNS traffic and deliver the exploit through intercepted HTTP traffic, without an attacker-link click. Both scenarios required an active Cloud Shell session. The stolen token could access Google Cloud resources within the victim's existing permissions and carried Drive and identity scopes, extending the potential impact beyond Cloud Shell. It did not grant permissions the victim did not already have. Google patched the vulnerability on 22 July 2026 and published the CVE on 20 October 2026 . No customer action is required. The finding highlights why authenticated WebSocket services must validate both the requesting origin and the internal destinations they expose. 1. The finding Google Cloud Shell gives users an authenticated cloud environment directly in the browser. During my research, I found that a malicious website could abuse Cloud Shell’s own WebSocket connection to reach an internal service and steal Cloud Shell’s authorized user token. The token included the broad cloud-platform OAuth scope and could act with the victim’s existing Google Cloud permissions. The attack could be delivered in two ways: One-click, from anywhere: if the attacker knew the victim’s Cloud Shell hostname, opening a malicious page was enough to trigger the attack. Zero-click, on the same network: a local-network attacker could learn the hostname from DNS traffic and deliver the exploit through ordinary HTTP traffic, without the victim clicking an attacker-supplied link. Both vectors required an active Cloud Shell session in the victim’s browser. Once the exploit page loaded, three bugs made the token theft possible: Cross-site authentication cookie: Cloud Shell set its authorization cookie with SameSite=None , so the browser also sent it with a WebSocket connection opened by a malicious website. Missing WebSocket Origin validation: the WebSocket endpoint accepted the attacker’s cross-site connection instead of restricting upgrades to trusted Google origins. Internal port exposed through the tunnel: the raw TCP tunnel allowed access to the metadata proxy on port 900 , which returned the victim’s OAuth token. Together, these bugs let an untrusted website open an authenticated tunnel through the victim’s browser and reach a token that should only have been available inside the Cloud Shell environment. The one-click and zero-click versions differed only in how the exploit page reached the victim. 2. WSSnatch at a glance The chain’s verified properties and delivery requirements are summarized below. Field Details Affected product Google Cloud Shell CVE CVE-2026-85267 , published 20 October 2026 · NVD Severity CVSS 4.0: 8.7 High, assigned by Google Cloud Weakness CWE-1385: Missing Origin Validation in WebSockets Remediation Patched 22 July 2026. No customer action required. Vulnerability type Cross-Site WebSocket Hijacking through an unrestricted WebSocket-to-TCP tunnel Demonstrated impact Theft of the active user’s authorized OAuth access token Observed token scopes cloud-platform, drive, and identity scopes Disclosure status : Google Cloud VRP accepted and rewarded the report. The official CVE record , published on 20 October 2026, includes credit for the research and states that the vulnerability was patched on 22 July 2026. Google's July 28, 2026 release notes describe the mitigation. The patch date, release-note date, and CVE publication date are separate milestones. The chain had two demonstrated delivery models: Dimension One-click, remote Zero-click, same network Attacker position Anywhere on the internet Same Layer 2 network as the victim Victim action Loads an attacker-controlled page None Victim session prerequisite Active Cloud Shell session in the browser Prior target knowledge Cloud Shell editor hostname None; hostname learned from observed DNS traffic Exploitation primitive Cross-site WebSocket Network interception followed by the same cross-site WebSocket Result OAuth token theft The two variants used different delivery paths, but the server-side vulnerability was identical. 3. How the research started I started this research the same way I approach any new challenge: enumerate first and make as few assumptions as possible. From inside the Cloud Shell instance, I mapped the processes, listening ports, network routes, mounts, namespaces, environment variables, and metadata endpoints to understand what was running around my shell. The terminal was running inside a user container on a per-user Container-Optimized OS VM. That VM also hosted several supporting containers, including an orchestrator, a gateway, and a metadata proxy listening on 127.0.0.1:900 . The browser reached the environment through a Google-managed editor hostname, with WebSockets used to bridge browser connections to ports inside the container. 3.1 Two identities behind metadata.google.internal The metadata service was where things became interesting. Querying the same metadata hostname on two different ports returned two different identities: Port 80: authorized user-token path curl -sS -H "Metadata-Flavor: Google" \ "http://metadata.google.internal:80/computeMetadata/v1/instance/service-accounts/" default/ <my-user-email>/ curl - sS - H "Metadata-Flavor: Google" \ "http://metadata.google.internal:80/computeMetadata/v1/instance/service-accounts/" default / < my-user-email > / Port 8080: VM infrastructure identity curl -sS -H "Metadata-Flavor: Google" \ "http://metadata.google.internal:8080/computeMetadata/v1/instance/service-accounts/" default/ vms-cs-<region-and-pool>@<tenant-project>.iam.gserviceaccount.com/ curl - sS - H "Metadata-Flavor: Google" \ "http://metadata.google.internal:8080/computeMetadata/v1/instance/service-accounts/" default / vms - cs -< region - and - pool >@< tenant - project >. iam . gserviceaccount . com / Port 80 was not reaching the real GCE metadata service directly. A per-pod DNAT rule redirected 169.254.169.254:80 to the local metadata proxy on port 900 , which injected my authorized user OAuth token. That token carried the broad cloud-platform scope, along with Google Drive and identity scopes. Port 8080 followed a different path. It passed through to the real GCE metadata server and returned the service-account token belonging to the Cloud Shell VM. In my tests, that infrastructure identity was tightly scoped to devstorage.read_only , logging.write , and monitoring.write . The two metadata paths looked like this: The same metadata hostname resolved to a signed-in user credential on port 80 and a separate VM infrastructure credential on port 8080. The :8080 behavior was a separate finding, but it helped me understand the architecture: Cloud Shell deliberately placed the user’s OAuth credential behind an in-container proxy, while the VM retained a separate, low-privilege infrastructure identity. For this research, the important target was the user-token proxy on port 900 . 3.2 Switching from the container to the browser Up to this point, the enumeration had been entirely backend-focused, from inside the container. I decided to switch perspectives and study the client side: how the browser provisioned the environment, authorized the session, discovered my instance, and finally connected to the terminal and editor. I captured the complete startup flow from shell.cloud.google.com to the per-session *.cloudshell.dev data plane. 3.3 Mapping the victim-specific Cloud Shell endpoint The next step was understanding how the browser located my environment. Several different names appeared during the session, but they represented different layers of the architecture. The underlying GCE VM had an ephemeral instance name such as cloudshell-<random-id> . That name and the VM’s IP address changed when the environment was reprovisioned, and neither was used by the browser-facing attack. Cloud Shell also assigned the environment a logical identity based on my Google account’s numeric GAIA ID:" cs-<GAIA-ID>-default cs -< GAIA - ID >- default was the Cloud Shell environment name. Google then combined this identity with the regional Cloud Shell pool to build the public session hostname: cs-<GAIA-ID>-default.<regional-pool>.cloudshell.dev cs -< GAIA - ID >- default .< regional - pool >. cloudshell . dev For example, a session running in the cs-europe-west4-bhnf pool followed this structure: cs-<GAIA-ID>-default.cs-europe-west4-bhnf.cloudshell.dev cs -< GAIA - ID >- default . cs - europe - west4 - bhnf . cloudshell . dev The terminal connected to that base hostname, but the editor used a port-prefixed host: 970-cs-<GAIA-ID>-default.<regional-pool>.cloudshell.dev 970 - cs -< GAIA - ID >- default .< regional - pool >. cloudshell . dev This distinction became important for the one-click attack. During the normal startup flow, Cloud Shell called /_cloudshell/login on the 970- editor host and set the CloudShellAuthorization cookie there. The cookie had no Domain attribute, so the browser scoped it to that exact hostname. An attacker could not simply target any Cloud Shell URL. The remote exploit needed the victim’s full editor hostname, including both the GAIA ID and the regional pool, and had to open the WebSocket against the same 970- host: wss://970-cs-<GAIA-ID>-default.<regional-pool>.cloudshell.dev/_cloudshell/tcp/900 wss : //970-cs-<GAIA-ID>-default.<regional-pool>.cloudshell.dev/_cloudshell/tcp/900 That targeting requirement is what separates the remote one-click vector from the same-network zero-click vector. Remotely, the attacker needed to learn or derive the hostname in advance. On the same network, the hostname could be observed directly when the victim’s browser resolved the Cloud Shell domain. 4. Three trust boundaries that failed While analyzing the browser’s startup traffic, I saw Cloud Shell mint an environment-bound JWT and send the browser to the 970- editor host: GET /_cloudshell/login?token=<environment-JWT> Host: 970-cs-<GAIA-ID>-default.<regional-pool>.cloudshell.dev GET / _cloudshell / login ? token = < environment-JWT > Host: 970-cs- < GAIA-ID > -default. < regional-pool > .cloudshell.dev The response stored that JWT in a cookie: Set-Cookie: CloudShellAuthorization="Bearer <environment-JWT>"; Path=/; Max-Age=86400; HttpOnly; Secure; SameSite=None Set - Cookie : CloudShellAuthorization = "Bearer <environment-JWT>" ; Path =/; Max - Age = 86400 ; HttpOnly ; Secure ; SameSite = None This cookie carried the browser’s data-plane authorization state for that exact Cloud Shell environment. On later requests and WebSocket upgrades to the same 970- host, the browser attached it automatically, and the backend validated that the JWT belonged to the requested environment. With the hostname and authentication flow mapped, I looked at what else the editor host exposed. Cloud Shell provided a WebSocket endpoint in this form: wss://<editor-host>/_cloudshell/tcp/<port> wss : //<editor-host>/_cloudshell/tcp/<port> Once upgraded, the WebSocket acted as a raw TCP bridge to the selected port inside the user container. Cloud Shell’s web-preview feature explicitly rejected sensitive ports such as 900 , but the WebSocket tunnel did not apply the same restriction. That meant a browser connection could potentially reach the metadata proxy and the user OAuth token behind it. From there, the research became a simple chain of questions: would the browser attach the Cloud Shell authentication cookie cross-site, would the server accept a WebSocket opened by an unrelated website, and could that connection reach port 900 ? The answer to all three was yes. 4.1 Bug 1: A cross-site authentication cookie HttpOnly prevented page JavaScript from reading the cookie value directly, but that did not stop the browser from using it. As MDN documents , HttpOnly cookies are still sent with JavaScript-initiated requests, and SameSite=None permits a cookie to be sent in both same-site and cross-site contexts. This distinction is central to CSWSH: the malicious page does not need to read or steal the session cookie first. It asks the browser to open a connection, and the browser authenticates that connection on the page’s behalf. SameSite=None may be necessary for some embedded product flows, so this attribute alone should not be treated as the complete vulnerability. It became exploitable because the server did not independently verify who initiated the WebSocket. Figure 1. The original authorized capture showed that the Cloud Shell authorization cookie was eligible for cross-site use and remained valid for 24 hours. Sensitive values and identifiers are redacted. 4.2 Bug 2: The WebSocket upgrade trusted every Origin Browsers add an Origin header to WebSocket handshakes. Page JavaScript cannot freely replace that header, so the server can use it to distinguish a legitimate application from an attacker-controlled website. In testing, the Cloud Shell TCP endpoint returned 101 Switching Protocols for: Origin: https://attacker.example Origin: null No Origin header Origin: https://shell.cloud.google.com Origin : https : //attacker.example Origin : null No Origin header Origin : https : //shell.cloud.google.com There was no effective origin allowlist. This removed the key server-side protection against CSWSH. The endpoint did not distinguish a WebSocket created by Cloud Shell from one created by an unrelated page. OWASP recommends validating every WebSocket handshake against an explicit allowlist and rejecting null , missing, wildcard, or substring-matched origins. At this point, an attacker-controlled page could create an authenticated WebSocket connection. The remaining question was what that connection could reach. Figure 2. The TCP WebSocket upgraded connections regardless of whether the initiating origin was foreign, null, absent, or legitimate. 4.3 Bug 3: The tunnel reached the token service on port 900 Cloud Shell’s web preview path rejected access to internal port 900 : GET https://900-<redacted-editor-host>/ HTTP/1.1 400 Bad Request invalid port GET https : //900-<redacted-editor-host>/ HTTP / 1.1 400 Bad Request invalid port The WebSocket TCP tunnel did not apply the same restriction: wss://<redacted-editor-host>/_cloudshell/tcp/900 wss : //<redacted-editor-host>/_cloudshell/tcp/900 After the WebSocket upgrade, I sent an ordinary HTTP request as raw bytes: GET /computeMetadata/v1/instance/service-accounts/default/token HTTP/1.1 Host: metadata.google.internal Metadata-Flavor: Google Connection: close GET / computeMetadata / v1 / instance / service - accounts / default / token HTTP / 1.1 Host : metadata . google . internal Metadata - Flavor : Google Connection : close Port 900 exposed the Cloud Shell environment’s metadata proxy. { "access_token": "ya29.<redacted>", "expires_in": 3600, "token_type": "Bearer" } { "access_token" : "ya29.<redacted>" , "expires_in" : 3600 , "token_type" : "Bearer" } Google’s Compute Engine documentation documents the same metadata path and the required Metadata-Flavor: Google header. A process legitimately running inside a VM can use this endpoint to obtain an access token. The vulnerability was that an untrusted website could reach that inside-only service through an authenticated tunnel. The web preview and raw TCP features had different port policies. One recognized port 900 as unsafe; the other exposed it. Figure 3. Two routes to the same port enforced different trust policies: web preview blocked port 900, while the raw TCP WebSocket exposed it. 5. The one-click attack, end to end The remote proof of concept was intentionally small. It served a page that executed the following logic when loaded: Figure 4. The WSSnatch one-click attack flow: SameSite=None, missing WebSocket Origin validation, and an unrestricted TCP tunnel combine to expose the victim’s Google OAuth token. const ws = new WebSocket( "wss://<victim-editor-host>/_cloudshell/tcp/900" ); ws.onopen = () => { ws.send( "GET /computeMetadata/v1/instance/service-accounts/default/token HTTP/1.1\r\n" + "Host: metadata.google.internal\r\n" + "Metadata-Flavor: Google\r\n" + "Connection: close\r\n\r\n" ); }; const ws = new WebSocket ( "wss://<victim-editor-host>/_cloudshell/tcp/900" ); ws . onopen = () => { ws . send ( "GET /computeMetadata/v1/instance/service-accounts/default/token HTTP/1.1 \r\n " + "Host: metadata.google.internal \r\n " + "Metadata-Flavor: Google \r\n " + "Connection: close \r\n\r\n " ); }; The browser added the Cloud Shell cookie to the handshake. The server accepted the attacker’s origin and upgraded the connection. The JavaScript then spoke HTTP through the WebSocket-to-TCP bridge, extracted the redacted ya29.* token from the response, and sent the result back to the proof-of-concept collector. No browser extension, local malware, attacker Google account, or direct read access to the victim’s cookies was required. The remote variant did have two important preconditions: The victim needed an active Cloud Shell authentication context in the tested browser. The attacker needed the victim’s editor hostname and needed the victim to load the malicious page. 6. Turning one-click into same-network zero-click The editor hostname was the main targeting requirement in the remote scenario. I next tested whether a local-network attacker could remove it. The same-network proof of concept combined standard local interception techniques with the same three server-side bugs: The attacker placed themselves in the victim’s network path using ARP poisoning on a shared Layer 2 network. When the victim opened Cloud Shell, DNS traffic disclosed the victim-specific Cloud Shell hostname and regional pool. The proof of concept disrupted known encrypted-DNS paths to encourage system-DNS fallback in the tested setup. It spoofed a suitable DNS response and injected an HTTP 302 redirect into intercepted plain-HTTP traffic, causing the browser to load the exploit page. The exploit page opened the authenticated WebSocket to port 900 and recovered the OAuth token. Figure 5. The WSSnatch same-network flow: the attacker first enters the network path, learns the victim-specific Cloud Shell hostname, delivers the exploit through an ordinary HTTP request, and chains the three server-side bugs to recover the OAuth token. In the tested environment, delivery could be triggered when the user made a normal plain-HTTP request. The victim did not need to click a link supplied by the attacker or enter any information into an attacker-controlled page after activating Cloud Shell. “Zero-click” here refers to the delivery interaction, not an absence of preconditions. The attacker still needed Layer 2 network access, the victim needed an active Cloud Shell session, and the network/browser behavior had to permit the demonstrated interception path. This is realistic on shared networks only where client isolation and related controls do not block ARP-based interception. It should not be generalized to every corporate, hotel, airport, conference, or coffee-shop network. 7. One stolen token, access far beyond Cloud Shell The recovered token was checked against Google’s token information endpoint. In the authorized test account, it carried: https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile openid https : //www.googleapis.com/auth/cloud-platform https : //www.googleapis.com/auth/drive https : //www.googleapis.com/auth/userinfo.email https : //www.googleapis.com/auth/userinfo.profile openid This was not a narrow Cloud Shell session token. The recovered credential carried Google’s global cloud-platform scope , allowing it to call Google Cloud APIs as the victim across services. The scope was Cloud-wide; the specific actions available were the actions authorized by the victim’s IAM permissions. The same token also carried the unrestricted drive scope , which Google defines as permission to view and manage all of the victim’s Drive files. Impact: broad compromise of the victim’s Google Cloud and Google Drive access from one stolen token. An attacker could act across every Google Cloud service permitted by the victim’s IAM roles, view or modify all Drive files, and recover the account’s verified email identity and profile. The demonstrated scope set did not include Gmail permissions or account-recovery controls. The proven impact was Cloud and Drive compromise plus Google account identity exposure, not Gmail mailbox access or password takeover. Figure 6. The recovered token included the broad cloud-platform scope alongside Drive and identity scopes; account identifiers and the token value are excluded. 8. Why the chain was more than the sum of its parts Each issue crossed a different trust boundary: Cookie policy: the browser was allowed to authenticate a cross-site connection. Handshake policy: the WebSocket server accepted an untrusted initiator. Destination policy: the tunnel exposed a credential-bearing internal service. No single layer had enough context to make the complete attack obvious. The cookie configuration may have supported an embedding requirement. The WebSocket endpoint may have assumed the cookie proved legitimacy. The tunnel may have assumed only the trusted Cloud Shell frontend could invoke it. That is the deeper failure mode: distributed security assumptions without a single enforced policy. The chain also demonstrates why port-forwarding features require more than network filtering. Once a browser-facing service can carry arbitrary bytes to internal destinations, it becomes a security boundary comparable to SSRF protection, a reverse proxy, and a session-authenticated API at the same time. 9. Fixing all three trust boundaries Google's release notes describe stricter WebSocket Origin validation and an allowed port list for TCP and SSH tunnels. The official CVE record dates the patch to 22 July 2026 and identifies earlier Cloud Shell deployments as affected. Google states that no customer action is required. Fixing any one of the three bugs would break the demonstrated chain, but all three should be addressed: 1.  Validate WebSocket origins: Allow only the exact trusted Cloud Shell origins and reject unknown, null , or missing origins. 2.  Harden browser authentication: Avoid using a cross-site cookie as the only authorization for a sensitive WebSocket. Use a stricter SameSite policy where possible or require a short-lived, connection-specific token. 3.  Restrict tunnel destinations: Apply the same port policy to every proxy and tunnel path. Internal services such as the metadata proxy on port 900 must never be reachable through the browser-facing TCP tunnel. 10. Disclosure timeline Date Event 24 June 2026 Report submitted to Google VRP with the complete PoC package and video demonstrations. An automated receipt was received. 10 July 2026 Google accepted the report and filed an internal bug with the responsible engineering team. 22 July 2026 Google patched the vulnerability, according to the official CVE record . 28 July 2026 Google's release notes document the mitigation for CVE-2026-85267. 6 August 2026 Google Cloud VRP awarded a bounty and described the submission as “a report of exceptional quality.” 20 October 2026 Google Cloud published CVE-2026-85267 , gave credit for the research, and assigned CVSS 4.0: 8.7 High and CWE-1385. I sincerely appreciate the Google Cloud VRP team’s communication throughout this process. They responded quickly, communicated the status and assessment transparently, and moved the report into remediation without delay. Their openness, professionalism, and recognition of the research made this a remarkably positive disclosure experience. 11. Conclusion Cloud Shell’s browser experience crossed several powerful boundaries at once: authenticated web state, a bidirectional socket, arbitrary TCP forwarding, and an internal metadata service. The vulnerability appeared when each layer relied on another layer to decide whether a connection was safe. The final exploit did not break TLS, steal the cookie with XSS, or compromise the Cloud Shell host first. It asked the victim’s browser to use a legitimate product feature from an illegitimate origin, and the system supplied the authentication and network reach needed to reach the token. WebSockets require special care because correct user authentication during the initial HTTP request does not automatically make the upgraded connection safe. After the protocol upgrade, the server must still validate the initiating origin and enforce what the socket is authorized to reach. Otherwise, a properly authenticated connection can remain open to control from an untrusted website. That is what made the chain dangerous, and what makes the lesson broadly applicable: browser-accessible tunnels must treat origin, session, and destination as one authorization decision. Cymulate Research Lab Our highly experienced and diverse researchers are fluent in security intelligence practices, combining expertise in private security, military, and intelligence experience. Continuously examining the cyber-threat landscape, our experts deliver in-depth visibility into today’s threats and the actors behind them. More about Author Table of Contents Executive Summary 1. The finding 2. WSSnatch at a glance 3. How the research started 4. Three trust boundaries that failed 5. The one-click attack, end to end 6. Turning one-click into same-network zero-click 7. One stolen token, access far beyond Cloud Shell 8. Why the chain was more than the sum of its parts 9. Fixing all three trust boundaries 10. Disclosure timeline 11. Conclusion Cymulate Exposure Validation makes advanced security testing fast and easy. When it comes to building custom attack chains, it's all right in front of you in one place. Mike Humbert , Cybersecurity Engineer DARLING INGREDIENTS INC. Learn More More from the Cymulate Research Lab View More Resources blog AKS RunCommand Vulnerability Enables Cross-Cluster Privilege Escalation A newly disclosed weakness in Azure Kubernetes Service’s RunCommand feature created a path for attackers to intercept a privileged Entra ID access Read More blog When Monitored Content Strikes Back: Account Takeover in Microsoft Purview Cymulate found a stored XSS flaw in Microsoft Purview that exposed reviewer tokens and enabled privileged account takeover. Read More blog CVE-2026-32196:  One-Click RCE via Windows Admin Center Control Flow Hijacking One click on a tampered WAC URL can trigger unauthenticated RCE across Windows Admin Center environments. Read More GET A PERSONALIZED DEMO Ready to see Cymulate in action? Book a Demo

csrfwebsocketoauth云 @cymulate-blog source ↗

CVSS 9.2、无需认证即可在 FPM 和 mod_php 上执行命令,已有在野利用动向,修补版本已给出。

Status: Patched · Exploitation attempts reported Severity: Critical, CVSS v4.0 9.2 (PHP security team) Overview PHP2Shell is two critical vulnerabilities in PHP, CVE-2026-109618 and CVE-2026-109619, that let an unauthenticated attacker run code on servers that use PHP to handle web requests. PHP released fixes on 21 October 2026. Update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, then restart every PHP worker. Am I Affected? Supported branches: PHP 8.2, 8.3, 8.4 and 8.5 are affected before 8.2.35, 8.3.36, 8.4.27 and 8.5.12 respectively, when serving web requests. PHP 8.6.0 release candidates before RC4 are also affected. End-of-life branches: PHP 8.1 and older no longer get upstream releases. Independent analysis traces the earliest affected code path to PHP 5.4.0; PHP has not stated a full affected range. Apache with mod_php: highest risk, according to PHP. Remote code execution is confirmed for both CVEs, and for CVE-2026-109618 with default input and memory limits. PHP-FPM: CVE-2026-109619’s session upload progress path was validated as RCE on a normal dynamic pool. For CVE-2026-109618, source analysis says FPM is susceptible, but no complete exploit has been demonstrated. FrankenPHP and LiteSpeed (LSAPI): susceptibility is based on source analysis only. No exploit has been validated, and PHP says this does not make them immune. How to Check List every PHP runtime that serves web traffic: main apps, internal tools, legacy apps, and PHP pulled in by container base images or OS packages. Check the version that actually serves requests. The CLI ( php -v ) can be a different build from PHP-FPM or Apache’s mod_php. For distribution packages, compare against your distribution’s advisory. Backported fixes may not change the upstream version number. After updating, rebuild and redeploy images, restart PHP workers, and confirm the new version is serving requests. Review activity from at least 17 October 2026. Look for new or modified PHP files, web shells, unexpected admin users and unusual outbound connections. Also look for unexpected child processes or shell commands launched by PHP or the web server: exploitation does not need to leave a web shell on disk. In request logs, AWS suggests looking for multipart POST requests containing the PHP_SESSION_UPLOAD_PROGRESS field. What to Do Update PHP to a fixed version. If you use your Linux distribution’s PHP packages, follow its security advisory. PHP says updating is the only complete fix. If you can’t update straight away, PHP’s advisories list settings that reduce the risk but don’t remove it. Set them administratively, so no pool, directory or app setting can override them: CVE-2026-109618: set memory_limit=-1 ; keep post_max_size conservative and enforce request size at the frontend; lower max_input_nesting_level and bound the number of input variables, multipart parts and uploads; block multipart requests at the frontend if your app doesn’t use them. Don’t use RLIMIT_AS or RLIMIT_DATA , which can trigger the vulnerable path. CVE-2026-109619: set session.upload_progress.enabled=0 and, on PHP 8.5, fatal_error_backtraces=0 . If performance allows, PHP also suggests pm.max_requests=1 . Restart every PHP worker after updating or changing settings. Fixed Versions Branch Fixed in 8.5 8.5.12 8.4 8.4.27 8.3 8.3.36 8.2 8.2.35 8.6 (RC) 8.6.0 RC4 7.4 to 8.1 Backports only 5.4 to 7.3 No upstream fix PHP 7.4, 8.0 and 8.1: no upstream release. PHP published minimal source backports for people who build from source. Distributions and LTS vendors may ship patched packages. PHP 5.4 to 7.3: end of life. Migrate, or get a backport from a supported vendor. Timeline Date Event 2026-10-17 AWS sees an exploitation attempt in its MadPot honeypots 2026-10-20 CVE IDs circulate; PHP posts an advance notice 2026-10-21 PHP ships fixes and advisories at 14:00 UTC, a day early 2026-10-21 AWS reports PHP2Shell is “broadly exploited in the wild” AWS says it is unclear whether the attempts it observed would have succeeded against real systems, and recommends investigating from at least 17 October. As of 22 October, no successful compromise of a real-world victim has been publicly documented. Technical Summary CVE-2026-109618, RCE via out-of-memory corruption: PHP exits out-of-memory errors with longjmp() . If memory runs out while request state is only partly initialised, shutdown can read or branch on invalid memory. An attacker can reach this through request input handling, including multipart parsing. CVE-2026-109619, RCE via stale global state: request-owned data can stay in worker globals after the request’s memory is freed, and a later request on the same worker can use it before normal initialisation. Confirmed early consumers are INI diagnostics and session upload progress. Impact includes use-after-free, memory disclosure and remote code execution with the web worker’s privileges. Both: unauthenticated and network-reachable, CVSS v4.0 9.2 ( AV:N/AC:H/AT:P/PR:N/UI:N ). Exploit reliability depends on the build, extensions, frontend and memory allocator layout. Update Log 22 October 2026: Initial publication. Status: patched, exploitation attempts reported. Not listed in CISA’s Known Exploited Vulnerabilities catalog (version 2026.10.21). References PHP advisory GHSA-w8hw-w9fx-j79w (CVE-2026-109618) PHP advisory GHSA-6wmf-4rv5-p3rp (CVE-2026-109619) PHP security advisory and release announcements, 20–21 October 2026 AWS: Amazon threat intelligence identifies PHP2Shell exploitation prior to public disclosure Tenable: PHP2Shell FAQ (earliest affected code path, PHP 5.4.0, citing Calif’s analysis) CISA Known Exploited Vulnerabilities catalog Credits, from PHP’s advisories: reported by sagitzadik-wiz, tomash-areion, lcfr-hax and amyb-oai; fixed by arnaud-lb, iluuu1994, bukka and ndossche.

rcephpcve补丁 @hacktron-blog source ↗
Must-see3

AI 大幅降低漏洞挖掘的难度和成本,防御思路需要从逐个修补转向可证明正确性。

Chapter 01 : Introduction Keane Lucas, Aengus Lynch, Luna Tong, Luke Champine, Zygi Straznickas, Dino Distefano, Harshikaa Agrawal Evyatar Ben Asher, Ava Howell, Sami Jawhar, Chris Rohlf, Nickolai Zeldovich Nicholas Carlini, Rajashree Agrawal, Jason Gross Most software is riddled with bugs, which AI can now easily find and exploit . The standard defenses against cyberattacks are no longer sufficient: we need ways to prove that code is free of bugs. Formal software verification could provide this guarantee, but it has historically required years of expert effort, making it impractical for most real-world projects. In a collaboration with Theorem , however, we show this is no longer the case: LLMs can now produce formal proofs at large scale, enabling new software development workflows that include proven security guarantees. Using Claude, we proved security properties at the assembly code level (RISC-V) in over 100 real-world open-source software libraries. To our knowledge, this represents the first large-scale effort to use AI to apply formal verification to production software at the assembly code level. While writing the proofs, Claude also discovered bugs that had eluded detection for years, despite trillions of test runs . As model capabilities continue to improve, we expect formal verification to become an essential part of secure software development. Introduction Even mature, heavily tested software contains bugs, and LLMs are increasingly adept at finding them. The Linux kernel—one of the most well-tested pieces of software today, deployed on billions of devices worldwide—recently had over 1,000 vulnerabilities disclosed. With frontier models becoming more capable of chaining seemingly benign bugs into critical exploits, we need techniques that can detect and fix these bugs before they can be exploited in the wild. Ideally, such techniques could find and patch all bugs, and then provide some proof that there are no more to be found. Formal verification is one way to do this. In formal verification, developers translate their code into a mathematical model, then try to prove that it always follows some defined set of security rules. If they fail to prove this, that means there could be a bug in the code that would violate a rule, and the nature of the failure implies what the bug might be. Repeating this process (after eliminating the cause of failure each time) will ultimately yield proof that the code is devoid of any bug that would violate those rules. However, formal verification isn’t easy. Proofs can be many times larger than the original code, and writing them requires significant effort and a niche, highly specialized skill set. For instance, it took two person-years to implement the seL4 operating system kernel, but 20 person-years to formally verify it . Accordingly, formal verification has been practical only in truly mission-critical applications, such as Airbus’s avionics code . But LLMs are making it far easier. Frontier models can now produce correctness proofs for real-world software fully autonomously. To demonstrate this, we asked Claude to prove useful security properties across 123 open-source libraries, including showing that some of their executable artifacts can never crash under certain conditions. Specifically, Claude proved that these programs will always exit normally without triggering memory-safety errors or failing assertions, for every input less than 64 MB and every modeled Linux operating system (OS) response and memory layout, under certain assumptions (namely that the program runs as a single-threaded static binary with a fixed memory budget on a RISC-V 1 CPU using Linux OS). This is still far away from fixing all possible bugs, but it does get us much closer than before and provides a roadmap toward that end. We’re publishing a subset of these proofs so that anyone can verify and reuse them, along with the RISC-V and OS semantics . Theorem , our collaborator on this project, is also offering to run the same pipeline for other open-source projects , and is publishing a Claude skill to help developers get started with verifying their own code. Formal verification is a broad field with many methodologies. Below, we also describe our initial explorations using other formal verification methods to accelerate other security or software development tasks, such as assessing the security of the zlib compression algorithm, proving behavioral equivalence of a Python interpreter written in Rust, and rooting out long-standing bugs in critical software. The road ahead for formal verification is promising. The cost of writing proofs is falling as models become more intelligent. Moreover, as more code is formalized and methods of achieving security guarantees become more standardized, the ability to reuse or modify proofs across codebases will amortize the cost. We encourage all developers to explore formal verification with LLMs— especially those who previously tried it with less capable models and found it didn’t work. In the rest of this post, we cover our formal verification experiments in more detail. Turning tests into proofs To prove that a piece of software is correct, we must first state what “correct” even means. Correctness is defined by the specification (spec). In some programs, there is a clear way to formally specify the program’s intended behavior. For example, a PNG decoder takes a sequence of bytes and (following RFC 2083 ) decodes these bytes into the corresponding image. But for most programs, things aren’t so straightforward. What would it mean for a text editor or a web browser to be “correct”? The difficulty of obtaining a comprehensive and unambiguous spec is a significant obstacle to verifying software at a larger scale. To address this for the code in the open-source libraries that we sought to prove, we take the approach of automatically converting their preexisting compilable test suites into a spec by encoding the rule “this test suite always passes,” using a general model of what it means to execute any RISC-V-compiled binary on Linux. Historically, proving such specs was intractable, given the inherent complexity of writing a proof that can encompass and make an argument over all possible behaviors and interactions of tens of thousands of assembly instructions over any input (and the fact that proofs tend to be extremely large as a result). This is where today’s LLMs come in: churning through millions of lines of code in pursuit of a well-defined goal is a task that LLMs are extremely well suited for. For this project, we started with fuzz tests . In these tests, developers write an entry point 2 into their code that takes inputs, such that any input that causes a crash is a bug the authors care about. Then the fuzzer, a testing engine, generates enormous numbers of semirandom and mutated inputs at the entry point to try to find a bug (visualized in Figure 1). The longer a fuzzer runs, the more bugs it can find. But this is inherently a brute-force process, with no guarantee of exercising every possible code path, regardless of how many inputs you try. Fuzzing works by running huge numbers of generated inputs through one entry point to find the inputs that cause a crash. There are infinite inputs, so the search can never be complete. To find all the bugs that would’ve been surfaced by a fuzz test, we turned the fuzz test into a spec defined over the compiled RISC-V instructions. The spec says that the fuzz test won’t crash for any input less than 64 MB. 3 If Claude can prove this spec, the fuzz test on RISC-V becomes superfluous: fuzzing that entry point will never find any bugs. We did this for hundreds of projects in Google’s OSS-Fuzz initiative, which provides continuous fuzz testing for qualifying open-source projects. OSS-Fuzz contains thousands of developer-authored entry points that look for broken code properties by crashing (for example, on a failed assertion). OSS-Fuzz automatically instruments C and C++ programs with AddressSanitizer 4 (ASan), causing them to crash whenever memory is accessed improperly (which is a leading cause of software vulnerabilities ). Broad-spectrum specifications like memory safety apply to almost all software. The open-source library and its existing fuzz test are compiled to a RISC-V executable. This executable, along with Theorem’s RISC-V and OS formal semantics and the desired no-crash property, mechanically yield a specification the proof must satisfy. Claude writes the proof; the Rocq kernel checks it against the specification. Green marks what’s proven, conditional on the trusted components being correct. Over the span of a few weeks, Claude successfully patched the bugs it found and then proved that there are no crashes on any input (up to 64 MB) for 239 entry points across 123 different OSS-Fuzz libraries. These proofs operate on the compiled RISC-V instructions (i.e., executable binaries), and they comprise about 180 million lines of Rocq, with a typical proof running to about 600,000 lines to provide security guarantees on binaries with a median length of 18,000 RISC-V instructions. These proofs are built by translating the RISC-V assembly code to a mathematical model using Theorem’s RISC-V instruction and Linux process semantics. This means these proofs currently assume that the program runs as a single-threaded static binary with a fixed memory budget on a RISC-V CPU using Linux OS. Expanding the scope of these proofs is well within reach, as it would involve standardizing semantics for more assembly architectures and other operating system processes. See an expert’s take on the proofs Claude wrote. A formal no-crash proof over all inputs rules out all crashes along any path reachable from the entry point. While iterating on its proof, Claude can also find and fix any remaining reachable crash-producing bug. While this is an enormous volume of proof code, virtually none of it needs to be manually reviewed. The Rocq proof checker ensures that the spec is correctly satisfied by the proof. As a result, the only artifacts that a developer needs to trust are: The formal models of RISC-V and of Linux processes; The exact theorem statements that were proved; The Rocq proof checker itself. 5 This doesn’t mean these libraries contain no bugs. Instead, it means that any remaining bugs either are to be found within the artifacts listed above or are outside the scope of Claude’s proof . Hardening those still-possibly-buggy trusted components (Rocq, RISC-V, and Linux semantics) is not insignificant, but it’s a far more tractable task than debugging every line of code the scaled-out proofs cover—especially as this approach can secure an arbitrary number of projects without increasing the size of the trusted components. We welcome independent verification of our proofs and encourage refinement of our approach. To that end, we are publishing the trusted components (above) made for this project that are not already public; Claude’s complete Rocq proofs for fuzz tests that did not require patching; and specifications for other fuzz tests we were not able to prove. Finding and fixing bugs Above, we showed that you can turn many open-source libraries’ developer-written tests (fuzz tests) into specs that Claude can prove will always pass, sometimes after patching the remaining bugs it found. For this reason, the process of attempting to prove these specs discovered hundreds of bugs. Lots of bugs showed up during Claude’s attempts to prove hundreds of entry points. To ensure that Claude didn’t have to stop for a human every time this happened, we let Claude fix the bugs it found: it patched the code, which caused the spec to be regenerated with that patched code, and then Claude proceeded to prove that new spec. 6 Many of the bugs we found are ones that a fuzzer would be unlikely to ever find. Fuzzers mutate small inputs, typically capped at 1 MB , and typically rely on code coverage to guide them toward bugs. While proving an entry point in one library, Claude found a counter underflow in its copy of a decompressor that led to an out-of-bounds write, but only on inputs of around 20 MB that had one rare, specific layout. Other bugs include an out-of-bounds read in an image decoder that needed a 64 MB input and over 2 GB of memory, an out-of-bounds read in another library that needed a particular sequence of calls across two handles to the same file, and a rediscovery of CVE-2026-56132 in libexpat, which needed deeply nested input. Claude also found logic bugs that never crash at all. While proving that one library was memory-safe, for example, it noticed that a feature for restricting which files an application can load isn’t always enforced. The ultimate goal of this project was to achieve a proof that the RISC-V-compiled fuzz tests had no remaining crashes to find. However, bugs like the above show that the process has another benefit, regardless of whether that goal is achieved: even just attempting this process yields real bugs that need to be fixed. Proving more than memory safety Proving that a fuzz test has no more crashes to find is more significant than it sounds. It’s common for fuzz tests in real-world code to test for violations of meaningful high-level properties, such as encode-decode roundtripping, idempotence, algebraic laws, differential testing, self-consistency, or equivalence to reference implementations. For example, a fuzz test for the LZO compression algorithm asserts that if you compress an input, then decompress it, the result is the same as the original. If the property does not hold, the program crashes—so proving the test never crashes is equivalent to proving the property itself. This can also occur even when the properties are not directly specified by the developer. For example, in order for Claude to complete its OSS-Fuzz proof for cpp-httplib, it was necessary to rule out the possibility of a stack overflow due to too much recursion in the std::set destructor. This recursion depth is bounded by the maximum depth of a tree, so Claude had to prove (on machine code!) that libc++’s red-black tree rebalancing algorithm is correctly optimized to keep the tree’s depth logarithmically bounded. Other formal verification case studies Formal verification is an expansive domain. The fuzz-test-to-proof example above is one instance of LLMs making formal verification more widely usable by directly applying proofs to machine code. We’ve also seen success using LLMs with formal verification in other ways. For example, we asked Claude to write a formal spec of RFC 1950 , the technical document that defines the zlib compression file format. Then, we had Claude prove that the zlib implementation in the Linux kernel correctly implements that spec. As with the examples above, Claude proved this property at the binary level, except instead of RISC-V, Claude directly proved the x86-compiled binary using Claude-generated (and heavily tested) formal semantics of the x86 ISA. 7 We then repeated this process for half a dozen other widely used libraries. Along the way, we found some minor (unexploitable) bugs in corner cases, which are in the process of being filed upstream. We draw two conclusions from this exercise: (1) these extremely well-tested codebases are already almost fully correct, and (2) it is possible to prove end-to-end correctness properties about real existing codebases. In another experiment, we asked Claude to develop an interpreter for a large subset of Python in Rust, and to prove (using Verus, a verification tool for Rust) that it adheres to the CPython semantics outlined in an academic paper. We then measured the adherence to CPython’s behavior empirically, running over 1.7 million randomly generated Python programs, finding identical behavior with CPython in 99.95% of tests, with remaining test differences as unsurprising known corner cases. We also found issues in several widely used and critical applications via formal verification attempts of simple security properties. In one of them, we discovered a previously unknown logic bug that had been latent for more than a decade. During an effort to verify a widely used PDF reader, we found as many security bugs in one week as are typically reported in a year. See the Appendix for more details on some of these efforts. This is just the beginning One of the key limitations of LLM-assisted formal verification is that the proofs can take hundreds of millions of tokens to produce. Cost-efficiency is critical if our goal is to make these methods available to the entire software ecosystem. Fortunately, there are compelling reasons to expect efficiency to improve. Newer models need fewer tokens We built 36 small verification tasks from real OSS-Fuzz code . Opus 5.5 proves half of them with about 40% fewer tokens than Opus 5. We expect this trend to continue as models are trained on long verification tasks. Opus 5.5 finishes proofs faster than earlier models. Share of 36 formal verification tasks proved by a single agent at a given token budget. Each task received three independent single-agent attempts at a 5M-token budget, and counts as proven when the first attempt finishes. Proofs can be reused When agents work separately, they often end up duplicating a lot of effort. Proofs, like software, are recursively built from smaller proofs—and the smaller the proofs are, the more reusable they tend to be. To measure the impact of this, we let agents copy each other’s proofs as they worked on proving their own targets. When given access to this shared workspace, agents needed 17% fewer tokens than when they worked alone, and some agents even succeeded after previously failing in a solo attempt. The 36 proofs from one shared workspace, in the order they finished. An arc joins any two proofs that share an unchanged file; bars show the tokens spent writing each proof, and black lines show the same task’s average cost for an agent working alone, which was higher in 30 of the 34 completed proofs (agents working alone were not able to complete two of the proofs). We observed the same phenomenon occurring at scale during our OSS-Fuzz proof effort. Most of a proof concerns code that every program contains (particularly initialization of the C runtime and AddressSanitizer), so very different programs can end up with significantly overlapping proofs. Agent teams took advantage of this by copying another team’s finished proof and then adapting it to their own program (Figure 6). Agents copied an existing proof and adapted it to each new program. Each column represents one program’s complete proof by share of bytes. Blocks are the parts of the proof and each block shows how much was kept identical, lightly edited (same file, size within 2%), edited more, or newly written. The shared parts gained almost no new code. This reusability of proofs is how Mathlib , a shared library of formal mathematics in Lean, grew to nearly 300,000 theorems submitted by over 700 contributors: each new proof builds on the existing body of work. We accumulated a similar body of proofs in the course of our OSS-Fuzz effort, some of which we’re including in our release (we are not releasing proofs that may reveal an unpatched bug in the open-source software). As we graduate from these initial experiments, we need a strategy for verifying the enormous body of existing software, starting with the most critical dependencies. As we’ve shown, this can be achieved at scale by using generic specs and working at the binary level, sidestepping the need to rewrite entire codebases in another language. This approach also facilitates the reuse of proofs at package-level granularity, which means that each dependency only needs to be verified once. Dependencies follow a power law: proving even a small set of shared libraries makes a huge swath of software feasible to prove. For more details, see Theorem’s roadmap for verifying the entirety of the Nix ecosystem, which includes critical infrastructure like glibc, OpenSSL, and cURL. Limitations In practice, formal verification can sometimes prove less about the security of the code than we would like. “Formally verified” does not mean “bug-free.” Claude can write a proof showing that a compiled program’s behavior satisfies the requirements of a formal spec (which is verified by an external proof checker). However, a proof checker can’t tell you whether your spec matches reality. To match reality, the spec must correctly encompass and model everything about the real-world machine that the verified program runs on, including the CPU and operating system. When bugs show up in verified code, it’s because the spec, or the assumed semantics of the machine, differs from reality. Fortunately, this also means we know where to look for remaining bugs, and how to design a system where those still-possibly-buggy gaps are minimized. Below are the ways this applies to our proofs, and ideas for future work that would close those gaps. The real machine does something the model doesn’t describe. Our proofs are about single-threaded, static RISC-V binaries linked against musl libc. However, most people run these libraries on x86 or ARM and dynamically link them against glibc. To close this gap, we’d need system models that more closely resemble deployed systems. For example, a step toward this would be generating accurate semantics for x86. The claim may not cover everything we care about. We proved that a crash never triggers for any input under 64 MB on many fuzzing entry points in Google OSS-Fuzz, including ASan crashes. However, ASan doesn’t detect all memory safety bugs, and we didn’t verify all the entry points for each library. Even if we had, the whole library wouldn’t be covered by verifying all entry points (especially if there is dead code). Additionally, real programs might misuse the library, leading to memory corruption in the caller . To close that gap, we’d need to specify what callers must do for each public function, and callers would have to strictly adhere to it. We expect that as we learn more about leveraging LLMs for formal methods, and as models continue to improve, these limitations will become tractable, and we’ll be able to verify a much larger percentage of the code we rely upon. Conclusion The trajectory is clear: formal verification, which was historically practical only for bespoke expert-crafted guarantees in the most safety-critical code, will soon be as practical as fuzzing is today for almost all production software. Just like static types, testing frameworks, and other correctness tooling, verification will mature from “bolted-on” to “built-in,” driven not only by LLMs but also by innovations in language design and development workflows. In today’s world—where LLMs automatically scan for and find increasingly more code vulnerabilities—we must use processes that can guarantee code security properties. LLM-scaled formal verification is a promising approach toward securing these guarantees at a scope and scale that were previously unattainable. We encourage others to experiment so we can collectively build a world in which robust software has proliferated very widely and software bugs are a well-understood and quickly addressable rarity. Read the full appendix. Footnotes 01 RISC-V is a processor design, like x86 or ARM, that defines the assembly instructions (the basic commands a chip carries out) that software is compiled into. 02 An entry point is a front door into the code, provided by its authors for testing. Any input to the entry point that causes a crash is a bug the authors care about. 03 Increasing this requires trivial human effort to change the parameter and regenerate the spec, then have Claude reprove the statement. 04 AddressSanitizer is a compiler tool that adds checks to a program so that memory errors, such as buffer overflows and use-after-free, are detected and reported the moment they occur at runtime. 05 This technically also means we have to trust the hardware, OS, OCaml compiler that the Rocq proof checker relies on. 06 Note this leaves open the door to reward hacking. Reward hacking is when an AI model finds a shortcut that technically meets the goal it was given without doing what was actually intended, like a student who passes an exam by memorizing the answer key instead of learning the material. In this context, Claude could make any theorem provable by rewriting the program into one that trivially never crashes. To discourage this, we penalized any patch and offered extra credit for proving which inputs it changes and how few they are. We also logged and audited the patches for these failure modes. 07 We think that the ability of Claude to—entirely autonomously—generate the formal semantics of an ISA is a separate interesting lesson. While we can not be sure our semantics themselves are perfect, empirically we have found that single-stepping through our semantics can boot an Ubuntu userspace on top of a Linux kernel. Generating these semantics also identified hundreds of mistakes in the official reference documentation, along with a smaller number of bugs in the hardware itself.

ai_agent形式化验证漏洞挖掘报告 @anthropic-research source ↗

补充漏洞机理与攻击面判断,是决定是否升级的根因材料。

Introduction CVE-2026-109618 and CVE-2026-109619 represent one of the most critical security emergencies in recent PHP history, threatening millions of active web servers globally. Highlighting the fundamental dangers of memory management flaws within persistent web server worker environments—such as PHP-FPM or Apache mod_php —these vulnerabilities enable unauthenticated remote attackers to execute arbitrary system commands with the privilege level of the underlying web service. Dubbed “PHP2Shell” by cybersecurity researchers, the combined exploit chain directly targets low-level fatal error handling routines in the Zend Engine core, turning standard memory exhaustions into total host compromise. Because the vulnerability manifests prior to application-level routing, standard code hardening within web applications fails to provide protection, leaving unpatched web infrastructure completely exposed. Learning Objectives By analyzing this security advisory and technical breakdown, you will learn to: Understand the Root Mechanism: Identify how low-level longjmp-based unwinding disrupts normal variable cleanup and state resetting in the C-based PHP Zend Engine. Grasp the Exploit Chain Architecture: Comprehend how an initial data-leak/memory corruption bug (CVE-2026-109618) combines with a cross-request Use-After-Free bug (CVE-2026-109619) to yield reliable Remote Code Execution. Assess Attack Vectors: Recognize how common HTTP interfaces (like multipart/form-data uploads) can trigger engine-level flaws prior to any application-layer code execution. Formulate Defense & Remediation: Implement immediate web-server mitigations and long-term patch strategies across both active and End-of-Life (EOL) PHP branches. What is Critical Unauthenticated Remote Code Execution in PHP (CVE-2026-109618 & CVE-2026-109619) Both vulnerabilities carry a CVSS v3 score of 9.2 (Critical) , reflecting their severity and ease of exposure across default installations. Unlike traditional application-level weaknesses—such as SQL injection, local file inclusion, or insecure deserialization written into custom scripts—these flaws reside deep within the C source code of the PHP engine itself. Consequently, every web application hosted on an unpatched PHP binary is exposed regardless of how securely the application code was written or audited. The underlying issue centers on how the Zend Engine manages worker process state when an out-of-memory (OOM) condition occurs. When a script or request parser exceeds the allocated memory_limit , PHP forces an abrupt execution halt using C-level longjmp() unwinding. This abrupt jump bypasses standard garbage collection and destructor routines, leaving allocated memory structures in a corrupted or partially initialized state. When persistent worker architectures process subsequent requests, these leftover memory pointers are incorrectly treated as active context. Because this memory corruption occurs during early request parsing—specifically while processing standard HTTP headers, body content, or file upload handlers—an attacker does not require valid credentials, session tokens, or access to specific application endpoints. Simply sending crafted HTTP requests directly to any valid PHP-serviced path triggers the underlying engine routines, making unauthenticated remote exploitation straightforward for persistent worker setups. CVSS Score: 9.2 (Critical) — High impact on confidentiality, integrity, and availability. Attack Vector: Network (Unauthenticated HTTP/HTTPS POST or GET requests). Core Vulnerability Mechanics: Out-of-memory longjmp() execution bypass combined with cross-request memory reuse. Affected Component: Core Zend Engine request lifecycle and memory allocator ( zend_alloc ). Technical Detail: How the Vulnerability Chain Works The mechanics of this security flaw rely on the architectural design of persistent PHP processes, such as PHP-FPM pools or FastCGI implementations. To minimize performance overhead, these worker processes remain alive after completing an HTTP request, waiting to process the next incoming connection in the same memory address space. When a memory allocation failure occurs during request handling, the engine must safely clean up the current request’s state and reset its internal allocator without terminating the entire worker process. However, the unwinding mechanism triggered by longjmp() fails to clean up complex nested data structures properly. When an allocation fails, the control flow jumps directly to the top-level error handler, skipping intermediate cleanup handlers for file upload monitors, global symbol tables, and internal buffers. This creates a desynchronization between the engine’s global tracker state and the actual allocated heap memory blocks managed by zend_alloc . When the persistent worker receives a follow-up HTTP request, the engine reinitializes request memory without fully resetting stale global pointers from the previous aborted execution. This architectural flaw allows an attacker to control the contents of freed memory via the first request, and then trick the engine into executing code paths derived from those dangling pointers during the second request. Prerequisite Condition: A web architecture utilizing persistent worker processes (e.g., PHP-FPM, Apache event MPM with FastCGI). Initial State Manipulation: Forcing memory exhaustion ( memory_limit boundary hit) during early request payload parsing. Memory Address Mapping: Utilizing uninitialized buffer reads during process failure to bypass ASLR protections. Control Flow Hijacking: Overwriting internal function pointer tables (such as zend_execute_internal ) in freed memory structures. Below is a conceptual terminal demonstration showing an administrator inspecting HTTP responses during a diagnostic test against an unpatched PHP worker: $ curl -i -s -X POST "http://target-server.local/index.php" \ -H "Content-Type: multipart/form-data; boundary=---------------------------109618109619" \ --data-binary "@large_payload.bin" HTTP/1.1 500 Internal Server Error Server: nginx/1.24.0 Date: Wed, 21 Oct 2026 20:41:00 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive X-Powered-By: PHP/8.3.35 Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 140000000 bytes) in Unknown on line 0 Step 1: Memory corruption during OOM handling (CVE-2026-109618) The first stage of the vulnerability chain relies on forcing an out-of-memory error during early request initialization. When an HTTP request containing large headers, structured parameters, or upload progress keys is received, the Zend Engine allocates heap memory to track incoming data structures. By crafting a payload that rapidly consumes memory right up to the configured memory_limit , the engine fails mid-allocation and immediately invokes the fatal error recovery routine via longjmp() . Because longjmp() abruptly transfers control back to the main request loop, standard destructors and pointer cleanup routines are skipped. Consequently, internal memory references remain registered in global engine trackers despite their underlying memory blocks being marked as reusable or uninitialized. This structural mismatch leaves valid global pointers referencing corrupted memory locations, laying the groundwork for process memory state leakage. Step 2: Use after free across requests (CVE-2026-109619) The second stage occurs when the persistent worker process accepts the subsequent HTTP request from the network. Rather than terminating the corrupted worker process, the web server reuses it to handle new traffic. As the engine initializes the context for the incoming request, it encounters leftover pointers that still reference the memory space freed during the previous request’s OOM failure. During initialization, incoming request data overwrites the freed memory region, allowing an attacker to populate those address locations with controlled payload values. When the Zend Engine attempts to invoke internal execution functions using the stale pointers, it mistakenly reads the newly supplied attacker data as valid function tables or execution contexts. This type confusion allows arbitrary control flow redirection, culminating in unauthenticated system command execution. Affected Software & Plugins Because these security flaws reside inside the core Zend Engine runtime, all web applications and CMS platforms deployed on unpatched PHP installations are vulnerable , regardless of application-level security controls, input validation, or framework-level sanitization. PHP 8.5 Branch: Versions 8.5.0 through 8.5.11 (Patched in 8.5.12 ). PHP 8.4 Branch: Versions 8.4.0 through 8.4.26 (Patched in 8.4.27 ). PHP 8.3 Branch: Versions 8.3.0 through 8.3.35 (Patched in 8.3.36 ). PHP 8.2 Branch: Versions 8.2.0 through 8.2.34 (Patched in 8.2.35 ). Applications built on popular content management systems and frameworks—including WordPress, Drupal, Joomla, Laravel, Symfony, and Magento —are instantly exposed if hosted on vulnerable binary versions. Legacy environments running End-of-Life (EOL) versions (such as PHP 7.x or 8.1) do not receive official upstream patches and require operating system distribution backports or immediate upgrading to supported releases. Conclusion CVE-2026-109618 and CVE-2026-109619 highlight the severe implications of memory safety vulnerabilities in underlying server runtimes. When engine-level cleanup routines fail during exceptional error states like OOM conditions, traditional application-layer defenses offer no security margin. Organizations must treat these advisories as high-priority infrastructure threats requiring rapid patch validation and deployment. System administrators and DevOps teams should immediately audit active environments and update PHP packages to patched releases ( 8.2.35+ , 8.3.36+ , 8.4.27+ , or 8.5.12+ ). For infrastructure running EOL branches where immediate upstream upgrades are infeasible, enterprise Linux security backports (such as Red Hat, Ubuntu ESM, or AlmaLinux advisories) must be applied without delay to secure persistent worker processes. In environments where immediate binary replacement is blocked by change freezes, temporary perimeter mitigations should be implemented. Web Application Firewalls (WAFs) and reverse proxies can be configured to inspect and block anomalous upload progress payloads or restrict maximum request body sizes below the PHP memory_limit threshold, preventing malicious requests from reaching vulnerable error-handling code paths. The Ultimate Reverse Shell Cheat Sheet What is an Advanced Persistent Threat (APT)? Vulnerability Analysis CVE-2026-87902 WordPress Core – PHP Template Path Traversal Vulnerability Analysis: CVE-2026-82329 JFrog Artifactory Access Authentication Bypass The Hidden Gateway to Enterprise Networks: Unbound DNS Flaw and the Threat to Global Resolvers The post Vulnerability Analysis: CVE-2026-109618 & CVE-2026-109619 Critical Unauthenticated Remote Code Execution in PHP appeared first on DenizHalil - Professional Cybersecurity Consulting and Penetration Testing .

rcephp分析 @denizhalil-blogs source ↗

PowerShell 默认部署广泛,网络向量 RCE 影响面大且修复需排期。

# CVE-2026-96251 - Microsoft PowerShell Remote Code Execution Vulnerability Reliance on untrusted inputs in a security decision in Microsoft PowerShell allows an unauthorized attacker to execute code over a network. CWE: CWE-807: Reliance on Untrusted Inputs in a Security Decision

rcepowershellcve @msrc source ↗
Recommended8

把 LLM agent 接入逆向分析流程的具体配置,可以直接照搬复现。

Quote: Originally Posted by NieteNr1 What has been working extremely well for me lately: - VS Code + Cline as the agent layer (it reads/writes files, runs commands, and iterates on its own output) - OpenRouter as the provider, so you can swap models without changing anything else - GLM 5.3 Flash through that setup, honestly surprisingly strong for both static analysis reasoning and generating tooling/scripts - REA as the binary analysis backend, which drives a headless Ghidra under the hood, so you get function dossiers, pseudocode and call graphs from a real decompiler, and an agent that can actually consume and verify that output Regarding safety mechanisms: cant really speak to that, because I simply never hit the wall. GLM 5.3 Flash does every reverse engineering task I throw at it, happy and without any pushback, no matter how it is worded. Disassembly, struct recovery, game memory layouts, cheat related research, all of it just gets done. Maybe other models are pickier, but with this setup the question never really came up Dang, Maybe i am doing osmething wrong, but i was just letting itself get up to date with my repo, and it didnt wanna touch anything lol. Sonnet 4.6 is the only thing thatd let itself go... thought your setup was going to be really promising. Maybe im seeing something differently? https://i.8upload.com/image/f836af63...0d/snippet.png

逆向ai_agent工具ghidra @unknowncheats-ac source ↗

CI/CD 平台发生 RCE,构建凭据与产物链会一并暴露。

# CVE-2026-105014 - Azure Pipelines Remote Code Execution Vulnerability Improper neutralization of special elements used in a command ('command injection') in Azure Pipelines allows an unauthorized attacker to execute code over a network. CWE: CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')

rceci_cdcve云 @msrc source ↗

SSRF 常被用来访问云元数据与内网服务,AI 平台实例需重点排查。

# CVE-2026-108456 - Azure AI Foundry Elevation of Privilege Vulnerability Server-side request forgery (ssrf) in Azure AI Foundry allows an authorized attacker to elevate privileges over a network. CWE: CWE-918: Server-Side Request Forgery (SSRF)

ssrf提权cveai_agent @msrc source ↗

认证绕过发生在身份边界上,所有使用该代理的租户都受影响。

# CVE-2026-97785 - AAD App Proxy Elevation of Privilege Vulnerability Improper authentication in AAD App Proxy allows an unauthorized attacker to elevate privileges over a network. CWE: CWE-287: Improper Authentication

提权绕过cve身份认证 @msrc source ↗

邮件服务是外部可达的基础设施,溢出类 RCE 修复优先级高。

# CVE-2026-96185 - Microsoft Exchange Online Remote Code Execution Vulnerability Stack-based buffer overflow in Microsoft Exchange Online allows an authorized attacker to execute code over a network. CWE: CWE-121: Stack-based Buffer Overflow

rcecve缓冲区溢出邮件 @msrc source ↗

CWE-306 缺失认证类缺陷在网络边界即可触发,AKS 用户需核查暴露面。

# CVE-2026-83938 - Azure Kubernetes Configuration Service Elevation of Privilege Vulnerability Missing authentication for critical function in Azure Kubernetes Configuration Service allows an unauthorized attacker to elevate privileges over a network. CWE: CWE-306: Missing Authentication for Critical Function

k8s云提权cve @msrc source ↗

绕过类漏洞常与既有加固策略冲突,需确认依赖该特性的防护是否失效。

# CVE-2026-96303 - Microsoft PowerShell Security Feature Bypass Vulnerability Improperly implemented security check for standard in Microsoft PowerShell allows an unauthorized attacker to bypass a security feature over a network. CWE: CWE-358: Improperly Implemented Security Check for Standard

绕过powershellcve @msrc source ↗
More4

前言 本文主要介绍模型训练所涉及的基础知识,以及在此基础上如何提高训练效率、加速模型训练。 姑且将 AI 系列后续内容分为以下 4 个部分: 学术篇: LLM 基础知识、模型训练、各类算法的原理与实现等。 开发篇: Agent 框架、各类 AI 应用的开发等。 运维篇: Agent 应用的部署、推理参数测试等。 杂项: AI 渗透、视频生成、音频生成、超分辨率等其他内容。 本来打算等 SMT 训练完成后再写这篇文章,但今天开始训练时,又学到了不少与训练效率相关的知识。为了梳理今天学到的内容,索性一边整理,一边把它们写成博客。 本篇快写完了,先做个总结。 总体来说,训练效率优化主要分为两步:首先优化代码执行效率,减少不必要的计算开销;然后在不超出硬件承载能力的前提下,尽可能提高 Batch Size,充分利用显存和计算资源,从而提升整体训练速度。 不过, 调整 Batch Size 不只是性能优化,也可能改变训练行为 ,进而影响梯度更新、收敛过程和最终结果。因此,在复现他人的源码时,如果目标是尽可能保持原有训练行为,就应优先优化代码执行效率,而不是随意修改 Batch Size 等训练参数。(因此,这次复现 只需优化代码 执行效率, 保持原有训练参数不变 ,直接部署到服务器训练即可,之前纠结于调整 Batch Size 加速训练其实没有必要。) 1. 基础知识 1.1 GPU 利用率(GPU Utilization) GPU 利用率主要衡量 GPU 在 一段时间内 处于活动状态的时间比例。 例如, nvidia-smi 中的 utilization.gpu 表示在最近 一个采样周期内 ,GPU 有多少时间在干活(即至少有一个任务正在执行)。 1.2 显存占用率(Memory Usage) 显存占用率衡量的是显存资源的使用情况,可以通过以下指标计算: 1 memory.used / memory.total 其中, memory.used 表示已使用的显存, memory.total 表示总显存。 在每个 batch 执行相同训练操作的前提下,可以将显存占用率简化理解为: 一个 batch 完整训练所需的显存资源与 GPU 总显存的比例 。 实际显存占用还可能包含 CUDA 上下文、缓存分配器预留的显存等额外开销。 1.3 资源利用率 计算资源 主要指 GPU 内部负责 执行运算的硬件单元 ,例如 SM(流式多处理器)及其中的 CUDA Core、Tensor Core 等。 可以将这些计算单元比作工厂里的工位:计算资源利用率反映的是这些硬件单元在执行任务时的实际繁忙程度。 如果部分计算单元没有得到充分利用,就意味着 GPU 仍有潜在的计算能力未被发挥出来。 怎么判断: 一般先看功耗: power.draw / power.limit 。 用 nvidia-smi 的 power.draw 除以该卡功耗上限( power.limit ),近似反映计算单元被铺满的程度。 这个方式方便快捷,日常一般就看它 ——功耗高说明计算单元在满负荷运转,功耗低说明大量计算单元闲着。 要精确看吞吐:steps/s 或 samples/s。 这是最准确的依据,但 nvidia-smi 看不到,需要在训练代码里自己计时统计 (如每个 step 记录时间戳,算每秒处理的 batch 数或样本数)。吞吐随 batch 增大而上涨,涨到不再涨,说明计算资源已吃满。 2. 训练计算流程原理 训练过程中,同一个 Batch 内的样本并行计算,而不同 Batch 的训练步骤通常按顺序执行。 batch 内部 : 并行计算 。一个 Batch 中的样本一起输入 GPU,由多个计算单元并行处理。若计算任务超过硬件的即时处理能力,就会分批执行。 batch 之间 : 依次执行 。 标准训练流程中,通常需要完成当前 Batch 的前向传播、反向传播和参数更新,才能开始下一个 Batch 的训练。 为什么 batch 之间必须串行: 下一个 batch 的计算要用更新后的权重,而权重更新要等上一个 batch 的梯度算完。后一步依赖前一步的结果,无法同时进行。 显存里同一时刻只有 一个 batch 的中间结果,所以显存是复用的:上一个 batch 的中间结果(各层激活值等)在反向传播算完梯度后不再需要,会被释放或覆盖,下一个 batch 的前向再从这块空间重新分配。因此显存占用不随 batch 数量累积增长,而是稳定在一个 batch 所需的峰值附近。 3. 资源利用耗时计算原理 前提 假设数据无限供应、显存无限,且每个样本处理时间相同,因此同样大小的 batch 处理时间相同。 在这个前提下,GPU 能做到不空等、一直在连续跑;采样时间内 GPU 一直有 batch 可处理,利用率达到 100%,此时采样时间内能处理的 batch 数量达到最大值 M。 实际中每个 batch 的处理速度并不完全相同,所以利用率 100% 时采样时间内的 batch 数量对应的指标其实是 吞吐 (steps/s 或 samples/s),需要在训练代码里自己计时统计, nvidia-smi 看不到。这里分析的是加速训练的因素,因此设定每个 batch 处理速度相同。 理想模型:一个样本作为一块 有 b 个计算单元,并行处理 b 个样本(资源 100% 利用),所需时间 t。 没吃满阶段(样本数 ≤ b): batch 加大,处理时间不变,仍为 t,吞吐随 batch 线性上涨。 吃满之后(样本数 > b): 处理时间 = ⌈样本数 / b⌉ × t。例如 b+1 个样本需要 2t,因为多出的 1 个样本要等下一轮计算单元空出来才能处理。 补充:这里隐含"每个样本正好占用 1 个计算单元、且耗时相同"的假设。若样本耗时不同,波次会出现"短板效应"——同一波里 最慢的样本 决定该波结束时间,部分计算单元会空转等待。 现实模型:一个样本被切成多个小块 一个样本会被切成多个小块。用 N 表示计算单元数(并行处理 N 个小块),s 表示一波(并行算一次小块)的时间,一个样本被切成 n 个小块。 一个 batch 的总块数 ≤ N: 一波算完,耗时 s。 总块数 > N: 耗时 = ⌈总块数 / N⌉ × s。 多加 1 个样本举例: 假设总块数刚好占满所有计算单元(正好排满整数波),此时多加 1 个样本,总块数增加 n,多出约 ⌈n / N⌉ 波的时间,每波只有 s。因为 s 远小于整个 batch 的耗时,所以增量很小,不会像理想模型那样直接变成 2t,曲线看起来是斜坡。 对比 理想模型: 多 1 个样本,可能多整整一轮,t 变 2t(阶梯状跳变)。 现实模型: 多 1 个样本,只多几个小波,耗时略增(近似斜坡)。 补充:两个模型的差异本质是 并行粒度 不同。 理想模型把样本当作不可分割的最小调度单位,资源利用率在"未满"与"满"之间突变; 现实模型把样本拆成小块,调度单位更细,能填满计算单元的空隙,因此耗时随 batch 增长更平滑。 实际 GPU 训练介于两者之间:粒度比"整样本"细,但受 kernel 启动开销、同步屏障、尾部效应(最后不足一波的部分)影响,斜坡上仍会有小台阶,不会完全平滑。 4. GPU 利用率、显存占用率、资源利用率三者关系举例 工厂(GPU) 来了一批 订单(batch) ,订单里每个产品提供了一份 原材料(样本) ,材料先存进 仓库(显存) ;100 名 工人(计算单元,如 SM、CUDA Core) 从仓库领材料干活,把每个产品做出来。 工厂 = GPU 一批订单 = 一个 batch 订单里的每个产品原材料 = 一个样本 仓库 = 显存 100 名工人 = 计算单元(SM、CUDA Core) 三个指标分别看什么 指标 工厂里的对应 看的是 GPU 利用率 工厂 有多少时间 在开工(哪怕只开一个工位) 时间 显存占用率 仓库 被占了多少 空间 资源利用率 多少工位 真正在干活 计算单元 举例 情况 A:活太少,工位大量闲置 工厂接到一批订单,但订单里只有 2 个产品,而工厂有 100 个工位。 GPU 利用率 :很高(接近 100%)。因为工厂 确实在开工 ,采样那一刻有工人在干活。(假设采样时间约等于做一个产品所需的时间,这里只有 2 个产品、2 个工人同时开工,整个采样窗口内工人一直在干活。) 资源利用率 :很低(2/100 = 2%)。只有 2 个工位在干活,98 个闲着。 显存占用率 :很低。订单少,仓库里只放了 2 份材料。 这说明: 利用率高 ≠ 算力吃满 。工厂开着门、有人在干活,但绝大多数工位是空的。 情况 B:活很多,但仓库爆了 订单里塞了 10000 个产品,仓库装不下,直接 OOM 报错(爆仓)。 显存占用率 :超过容量上限,OOM。 这说明: 显存是硬约束 。batch 再大、算力再足,仓库装不下就做不下去,此时该考虑混合精度、梯度检查点等省显存手段。 情况 C:工位和仓库都够,但原料送不上来(多 batch 情形) 工位 100 个、仓库也空着,但送订单的卡车(CPU 准备数据)太慢,工人干完一单(batch)就得等下一单到达才能干活。 GPU 利用率 :忽高忽低、经常掉到 0(工人在等原料)。(假设干完一单后,要等同样长的时间才能开始下一单,而采样窗口覆盖"这一单开始到下一单开始"这一段,则利用率为 50%。) 资源利用率 :忙的时候高,闲的时候低。 显存占用率 :不高(仓库没堆满)。 这说明: 瓶颈在数据供应(输入侧) ,不在算力和显存。 情况 D:工位和仓库都满,活也源源不断 GPU 利用率 :稳定 90% 以上。 资源利用率 :高(工位铺满)。 显存占用率 :高但没爆。 这才是 真正满负荷 的理想状态。 5. GPU 利用率低的原因与解决办法 GPU 利用率没满, 最常见的原因是输入侧(CPU 侧)跟不上 :在采样时间内,GPU 在等 CPU 处理的事情多。CPU 侧常见的有三种情况:数据准备跟不上、kernel 提交慢、同步操作打断流水线。 GPU 利用率没满, 多数情况下(尤其是单机单卡、中小模型)主因在 CPU 侧 :数据准备跟不上、kernel 提交慢、同步操作打断流水线。因此排查时应 优先从 CPU 侧入手 。 但大模型、多卡、长序列等场景下,多卡通信、显存带宽、GPU 内部依赖也可能成为主因,CPU 侧不再是唯一重点。 5.1 数据准备跟不上 现象: GPU 在等 CPU 提供数据。典型信号是 utilization.gpu 忽高忽低、经常掉到 0,而 power.draw 也不高。 解决办法:异步准备数据。 用后台线程/进程提前把 batch 准备好、放进队列,让训练函数直接从队列取到 GPU 上计算,而不是临时现准备。 PyTorch 中对应 DataLoader 的 num_workers > 0 (多进程预取)、 pin_memory=True (锁页内存加速 H2D 拷贝)、 prefetch_factor 控制预取批数。 若 num_workers=0 ,数据加载和训练串行,GPU 必然周期性空等。 5.2 小模型中 kernel 多且每个 kernel 计算量不大 现象: 有数据可算,但 CPU 提交 kernel 的速度跟不上 GPU 执行的速度 ,GPU 算完一个 kernel 后要等下一个指令。 kernel 是 GPU 上执行计算的最底层的任务单位。CPU 提交一个 kernel,GPU 执行一个 kernel。 模型里每个操作对应一个或几个 kernel。 每个 kernel 的计算量由参数规模、batch、序列长度共同决定。 CPU 提交完一个 kernel 后,立即开始准备下一个,不等 GPU 算完。 GPU 空等的情况: 若 CPU 提交一个 kernel 需要 20 微秒,而 GPU 执行它只需 5 微秒,那么 GPU 算完后要再等 15 微秒才能拿到下一个 kernel。这 15 微秒 GPU 处于空闲,会被计入未利用的时间,拉低 GPU 利用率。 解决方法: 加大 batch。 让每一步 GPU 计算所需时间增加,从而摊薄 CPU 提交开销。这是提高资源利用率 最直接 的手段,但它会改变训练行为。 torch.compile (算子融合)。 把多个小操作合并成一个大 kernel。比如"线性层 + 偏置 + 激活"原本是 3 个 kernel,合并后只发 1 次,CPU 发指令的次数直接减少。 note1: 算子融合除了减少 CPU 提交次数,还能减少 kernel 间的显存读写往返(中间结果不落显存),往往同时提升速度和降低显存占用。类似的还有手写融合算子、使用 torch.jit.script 等。 note2: 加大 batch 主要会影响以下训练行为: 每个 epoch 的更新步数变少 :数据量不变,batch 乘 k,步数除以 k。同样 epoch 数下,总共更新的次数少了。 梯度噪声变小 :每步梯度更准,但小 batch 的噪声有时有助于跳出尖锐极小值,所以 batch 过大可能泛化略差。 最优学习率变了 :步数少了、梯度更可靠了,原来的学习率偏保守,通常需要按比例调大(如线性缩放规则)。 显存占用上升 :batch 变大,每一步 forward 产生的中间计算结果(激活值)变多,所以每一份 batch 显存占用增加,可能 OOM。 BatchNorm 类层的统计量变化 (如果模型用了):batch 统计更稳定,行为会有细微差别。 5.3 大量同步操作 同步就是 CPU 停下来,等 GPU 把手上的活全算完,再往下走。 常见的触发点: loss.item() 、 print(tensor) 、 tensor.cpu() 、 .numpy() 、每步都调 torch.cuda.synchronize() 。其中 print(tensor) 之所以触发同步,是因为打印/格式化需要具体数值,必须把数据从 GPU 拷回 CPU。 CPU 停着等的这段时间,没法发新指令(kernel);GPU 算完后,要等 CPU 醒来,处理完触发同步的代码、然后再发下一批指令,这中间 GPU 又闲了。 完整时间线: CPU 发完一批 kernel,遇到同步点(如 loss.item() ),CPU 停下来等 GPU 算完。 GPU 把队列里的 kernel 全部算完。此时队列空了。 CPU 被唤醒,拿到结果,处理完同步点后面的代码(比如 print、转成 Python 数字)。 CPU 重新开始发下一批 kernel,又要经历一次 kernel 提交的开销 (准备kernel到发送给GPU的这段时间)。 在第 2 步结束到第 4 步发出新的 kernel 之间,GPU 是空的。 所以 GPU 空等的这一段,包含 CPU 被唤醒的延迟 、 处理同步点后代码的时间 ,以及 准备发出 kernel 所需的时间 。 日志/打印改为每 N 步一次(如 if step % 100 == 0 ),loss 累加用 tensor 在 GPU 上累积、最后统一取一次,避免每步 .item() 。真正必须同步的场合(如验证、保存 checkpoint)尽量放在 step 边界之外。 或者只取每第N步的loss记录日志。 6. 不同场景下的调优策略 6.1 加速常用的 4 种方法 手段 提什么 风险 加速原理 异步数据提供 GPU 利用率 无 数据加载与 GPU 计算重叠,减少 GPU 等数据的时间,从而提高 GPU 利用率 更快的 attention 速度 + 显存 低 分块计算、不物化完整的"序列长度×序列长度"attention 矩阵,减少显存读写和显存占用,序列越长收益越大 混合精度 AMP 速度 + 显存 低 大部分计算降为 16 位浮点,走 Tensor Core 加速矩阵运算,同时减少显存占用,使更大 batch 成为可能 torch.compile kernel 开销 + 显存 低~中 算子融合把多个小 kernel 合成一个,减少 CPU 提交次数和 kernel 间的显存读写往返 6.2 场景一:复现已有工作(论文/原项目) 在已有源代码的基础上,不去修改batch(修改batch会改变原本的训练行为,详细看5.2的note2部分)。 我们能做的仅有优化内部代码从而加速训练 添加异步数据提供(减少GPU的数据等待时间) 添加混合精度 AMP训练 网络使用更快的 attention 判断是否适合使用 torch.compile (判断标准看第7小节) 在已有源代码的基础上, 不改 batch (batch 由论文或原项目定,改它可能改变训练行为,见 5.2 的note2说明),只通过优化内部代码来加速训练: 异步数据提供 ——减少 GPU 等数据的时间。 混合精度 AMP ——加速计算、降低显存。 更快的 attention ——模型有 attention 时使用。 使用 torch.compile ——判断判断是否适合的标准见第 7 节。 6.3 场景二:自己训练模型 第一步:写代码时,先把这些手段配上 不用等发现瓶颈再加,写代码时直接配好,跑起来就是"已经拉满"的起点: 异步数据提供 。 混合精度 AMP :bf16 优先(通常不用 scaler);fp16 必须配 GradScaler 。走 Tensor Core 加速计算、降低显存。 更快的 attention (模型有 attention 时)。 torch.compile :如果模型结构固定、不会频繁修改,且符合使用要求,可以加上。 配好这些,GPU 利用率和显存占用基本就是当前代码能做到的较优状态,接下来只需调 batch。 第二步:调 batch 在 计算资源 和 显存 这两个约束下增大 batch,直到某个条件先达到 90% 左右为止; 两个条件都未到 90% 时,继续加 batch 。谁先到阈值就停在谁那里: 计算资源先到 90% :停,再加没有明显速度收益。判断信号是 功耗接近上限 ( power.draw / power.limit 接近 90% 左右即可,阈值本身留有余量,不必精确到顶)。 显存先到 90% 左右 :也停,再加有 OOM 风险。 注意: 不能超出显存是强制要求 。超了可能直接 OOM,也可能触发换页/卸载到主机内存等机制,大幅降低训练效率。 计算资源先到顶后仍可继续加 batch ,只是每个 batch 的处理时间会缓慢增加,速度收益递减。 一般来说,某个值先到 90% 时,训练速度就已经接近最大值了 ——因为很难精确计算“在显存范围内,超出多少计算资源还能继续提高整体速度”,所以用 90% 作为“大致到位”的经验阈值即可,不必追求精确最优点。 7. 三种加速方法的实现 训练加速主要可以从三个方面入手:编译模型、优化 Attention 计算、降低计算精度。它们分别减少模型执行开销、显存读写开销和单次计算成本。 7.1 torch.compile :编译模型 作用: 减少模型运行时的调度开销,并在适当情况下融合多个算子,从而减少 GPU Kernel 启动次数和中间结果的显存读写。 PyTorch 默认采用动态图执行方式,模型中的运算通常由 Python 逐步调度。 torch.compile 会对模型进行编译,生成经过优化的执行代码。 实现: 在模型初始化后添加一行代码。 1 2 3 4 5 6 7 # 初始化模型 self .rnn = RNN().cuda() self .teacher = Teacher().cuda() # 编译模型 self .rnn = torch. compile ( self .rnn) self .teacher = torch. compile ( self .teacher) 主要优化方式: 算子融合: 将多个可以融合的运算合并执行,减少中间结果的显存读写和 Kernel 启动次数。 减少调度开销: 降低 Python 逐个调度运算的开销,尤其适用于包含大量细碎运算的模型。 编译通常不会改变模型的数学计算目标,但浮点运算顺序可能发生变化,因此结果不一定逐位相同。 使用时需要注意: 首次运行会产生编译开销。 编译可能耗费数十秒甚至更久,具体取决于模型和配置。短任务可能还没来得及获得加速,实验就已经结束。 输入形状变化可能触发重新编译。 例如 Batch Size 或序列长度发生变化时,可能需要生成新的编译结果。 部分代码可能无法完整编译。 动态控制流、不受支持的 Python 操作等可能导致计算图中断,降低优化效果。 编译缓存默认位于本机缓存目录,不会自动随项目迁移。更换设备、软件环境或模型代码时,可能需要重新编译或生成新的缓存。 如何判断是否值得使用? 与其从各种角度去判断,不如直接从结果上判断是否能用。简单快捷。 采用 A/B 对比: 不使用 torch.compile ,运行一段时间,记录稳定后的训练速度。 使用 torch.compile ,首次编译和预热阶段后,以相同条件记录稳定后的速度。 对比两者的稳态速度,判断是否有利于加速。 如果模型结构和输入形状相对固定,且训练时间较长,通常值得尝试;如果加速效果不明显,就没有必要强行使用。 Windows 中文系统的编码问题 某些 PyTorch 编译环境在 Windows 中文系统下可能出现 UnicodeDecodeError 。原因可能是编译器读取内置模板文件时,使用了与文件内容不匹配的默认编码。 可以尝试启用 Python UTF-8 模式。 方法一:在代码最顶部设置,必须早于 import torch 。 1 2 3 4 import os os.environ[ "PYTHONUTF8" ] = "1" import torch 方法二:如果在 PyCharm 中运行,可以在运行配置的环境变量中添加: PYTHONUTF8=1 7.2 更快的 Attention:FlashAttention 作用 : 优化 Transformer 中 Attention 的计算过程,减少显存读写,提高计算速度并降低显存占用。 普通 Attention 需要生成一个序列长度 × 序列长度的注意力分数矩阵,并将中间结果写入显存,再读取出来进行后续计算。序列越长,这部分计算和显存开销通常越大。 FlashAttention 通过分块计算,利用 GPU 的高速片上存储处理计算过程,避免将完整的注意力分数矩阵写入显存。 主要优势: 更快: 减少中间结果的显存读写。 更省显存: 不需要显式保存完整的注意力分数矩阵。 计算精确: 不属于近似 Attention 算法,但浮点运算顺序不同可能导致微小数值差异。 PyTorch 中的实现 1 2 3 import torch.nn.functional as F output = F.scaled_dot_product_attention(q, k, v) PyTorch 会根据硬件、输入形状和数据类型等条件,自动选择合适的 Attention 实现,其中可能包括 FlashAttention 内核。 x-transformers 中的实现 如果当前版本支持 attn_flash 参数,可以在初始化 Decoder 时开启: 1 2 3 4 5 6 7 8 self .decoder = Decoder( dim=cfg.d_model, depth=cfg.decoder_depth, heads=cfg.n_heads, rotary_pos_emb= True , use_rmsnorm= True , attn_flash= True , ) 具体参数名称和底层实现取决于 x-transformers 的版本。开启该选项后,也不代表一定会使用 FlashAttention 内核,实际效果需要测试。 7.3 混合精度训练:降低计算精度 作用: 计算密集的算子使用 FP16 或 BF16 提高计算速度、减少显存占用;对数值精度敏感的运算则根据需要保留 FP32。 混合精度并不是将整个模型统一转换为 16 位,而是让不同运算使用合适的精度。 实现 : 使用 PyTorch 的 autocast 。 1 2 3 4 self .amp = torch.amp.autocast( "cuda" , dtype=torch.bfloat16, ) 1. 混合精度的工作原理 典型情况下,各部分的精度处理如下: 模型权重: 如果模型以 FP32 初始化,权重默认仍保持 FP32,不会因为进入 autocast 就永久转换成 BF16。 矩阵乘、卷积等算子: 通常可以使用 BF16 执行,以利用 GPU 的低精度计算能力。 Softmax、LayerNorm、Loss 等运算: 根据具体算子的精度规则,部分运算会使用 FP32,以提高数值稳定性。 优化器状态: 如果使用常规 FP32 模型参数和优化器配置,优化器状态通常也保持 FP32。 具体使用哪种精度由 PyTorch 的自动混合精度规则决定,并非所有敏感算子都会无条件使用 FP32。 2. 训练代码为什么这样排布? 1 2 3 4 5 6 7 8 9 10 model = Model().cuda() for x, y in loader: with self .amp: out = model(x.cuda()) loss = loss_fn(out, y.cuda()) loss.backward() optimizer.step() optimizer.zero_grad() (1) model = Model().cuda() :初始化模型 创建模型并将其移动到 GPU。这里没有指定其他数据类型,因此 模型参数默认保持 FP32 。 这使得后续可以在 FP32 主参数的基础上,通过 autocast 让部分运算使用 BF16。 (2) with self.amp: :开启自动混合精度 进入 autocast 上下文后,范围内的 运算 会 根据 PyTorch 的精度规则自动选择 BF16 或 FP32 。 (3) out = model(x.cuda()) :前向传播 将输入数据移动到 GPU,并执行模型的前向计算。 例如,矩阵乘法可能使用 BF16 计算。此时,原本的 FP32 权重不会被永久修改;对于支持自动转换的运算,PyTorch 会在计算时使用适当的精度。 (4) loss = loss_fn(out, y.cuda()) :计算 Loss 将 Loss 计算放在 with 内,是为了让它也处于自动混合精度的管理范围内。 例如,使用交叉熵损失时,PyTorch 的相应实现会根据精度规则选择合适的计算精度,部分计算可能提升到 FP32,以改善数值稳定性。 需要注意,把 Loss 放在 with 内,并不意味着它一定使用 FP32。具体精度取决于所用的 Loss 算子及其实现。如果放在外面,也不代表一定会用 BF16 计算。 (5) loss.backward() :反向传播 在 with 外执行反向传播即可。反向运算会依据对应前向运算的精度规则执行,不需要再额外包一层 autocast 。 (6) optimizer.step() :更新模型参数 优化器根据梯度更新参数。如果模型参数保持 FP32, 参数更新就作用于 FP32 权重 ,有助于保留较小的更新量。 3. 为什么混合精度能加速? 提高计算效率: GPU 对 BF16、FP16 等低精度运算通常具有更高的计算吞吐量。 减少显存读写: 16 位张量的存储空间通常只有 32 位张量的一半。 保留必要的数值精度: 不强制所有运算都使用低精度,而是通过自动精度规则兼顾速度与稳定性。 其中,BF16 的数值范围接近 FP32,通常比 FP16 更不容易发生数值溢出或下溢。在支持 BF16 的 GPU 上,可以优先尝试 BF16 混合精度训练。 补充图:

llm训练性能优化 @zusda source ↗

Detection engineering is both a role and an activity. It’s the discipline of building and maintaining the logic that identifies malicious or risky behavior within your organization. It’s where security analysis meets software engineering, turning raw logs and telemetry into actionable detections that defenders can rely on. Detection engineers bridge the gaps between security operations, threat intelligence, and infrastructure. They understand how attackers operate, how defenders respond, and how systems generate the data that supports those detections. A well-built detection can mean the difference between an alert that matters and one that drowns in noise. Precision and Recall: The Balancing Act Every detection faces a trade-off between precision and recall. Precision measures how much you can trust your alerts: of everything that fired, how much was actually malicious? High precision = fewer false positives = analysts trust the tool. Recall measures how much you’re catching: of everything malicious that happened, how much did you detect? High recall = fewer blind spots = threats don’t slip through. Detection engineering lives in the tension between the two: too much precision risks missing subtle threats; too much recall floods analysts with false positives. The goal is calibration through testing, iteration, and feedback. Core Components of Detection Engineering 1. Scoping and Prioritization Start with intent. What are you trying to detect, and why? Define the threats, behaviors, or assets that matter most, then align your work with frameworks such as MITRE ATT&CK®. Evaluate risk and value to determine which detections provide the highest impact for the effort required. Prioritize based on business importance and available telemetry. 2. Data and Telemetry Great detections rely on great data. Keep inventory of your logs. Validate that each contains the data you need. Normalize and enrich your logs so detections remain consistent across tools and environments. Understanding how logs are generated is essential to writing logic that fits your environment. 3. Detection Logic Development This is where hypothesis meets code. Write queries or rules that detect behaviors, not just static indicators. Combine multiple approaches: Signatures for known indicators of compromise (IoCs) Behavioral logic for Tactics, Techniques, and Procedures (TTPs) and patterns Anomaly models for statistical outliers 4. Testing and Validation Use adversary emulations or frameworks like Atomic Red Team to verify that your detections actually fire and your logging is working. Measure quality through precision, recall, and additional factors like confidence (how certain you are it’s malicious) and criticality (how severe the impact would be). 5. Deployment and Tuning Monitor performance, including trigger frequency, false positive rates, and analyst response time. Detection engineering is iterative and ongoing, not “write once and done.” 6. Documentation and Knowledge Transfer Good detections come with context. Record what the detection looks for, why it matters, what data it uses, and how it was tested. Version control your rules using Git and promote collaboration so analysts, hunters, and engineers can learn from one another. Playbooks and detection libraries ensure institutional knowledge does not disappear when staff change roles. 7. Metrics and Continuous Improvement Track measurable outcomes such as coverage across ATT&CK® techniques, number of validated detections, false positive rates, and mean time to detect. Regularly retire stale detections, update ones that drift, and automate validation wherever possible. Detection-as-Code practices keep everything maintainable and scalable. Building the Skillset Detection engineering requires a strong foundation in logging, security tooling, and incident response. You should understand when it’s best to detect, when to block, and how to use data sources effectively. Whether you’re building your first rule or managing hundreds, the mindset remains the same: test everything, learn constantly, and make each detection better than the last. Get Started Explore resources like: detectionengineering.net and SigmaHQ. Follow community leaders like: Zack Allen (Detection Engineering Weekly) and Haider Dost (Threat Detection Maturity Framework). Study detections and see how others approach logic design at: research.splunk.com Read: Practical Threat Detection Engineering. For more resources check out: https://bit.ly/notlogic

检测工程蓝队日志 @bhis-blog source ↗

链接跟随属于老类缺陷,需确认是否已修复及可达网络向量。

# CVE-2026-110063 - VM Inspector for Azure Virtual Machines Elevation of Privilege Vulnerability Improper link resolution before file access ('link following') in VM Inspector for Azure Virtual Machines allows an unauthorized attacker to elevate privileges over a network. CWE: CWE-59: Improper Link Resolution Before File Access ('Link Following')

云提权cve @msrc source ↗

量化多 agent 的收益边界,可作为架构选型参考而非安全议题。

多 agent 的成本是单干的数倍,但它买到的不是更强的智能,而是端到端时间、查漏补缺、搜索多样性和上下文隔离。文章用 Vals、Cohere、微软研究院和 Anthropic 的实测数据,拆开这笔交易的账本。

ai_agentllm @yage-share source ↗