frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

AIsbom – open-source CLI to detect "Pickle Bombs" in PyTorch models

https://github.com/Lab700xOrg/aisbom
25•lab700xdev•1h ago

Comments

lab700xdev•1h ago
Hi HN,

I’ve been working with ML infrastructure for a while and realized there’s a gap in the security posture: we scan our requirements.txt for vulnerabilities, but blindly trust the 5GB binary model files (.pt) we download from Hugging Face.

Most developers don't realize that standard PyTorch files are just Zip archives containing Python Pickle bytecode. When you run torch.load(), the unpickler executes that bytecode. This allows for arbitrary code execution (RCE) inside the model file itself - what security researchers call a "Pickle Bomb."

I built AIsbom (AI Software Bill of Materials) to solve this without needing a full sandbox.

How it works: 1. It inspects the binary structure of artifacts (PyTorch, Pickle, Safetensors) without loading weights into RAM. 2. For PyTorch/Pickles, it uses static analysis (via pickletools) to disassemble the opcode stream. 3. It looks for GLOBAL or STACK_GLOBAL instructions referencing dangerous modules like os.system, subprocess, or socket. 4. It outputs a CycloneDX v1.6 JSON SBOM compatible with enterprise tools like Dependency-Track. 5. It also parses .safetensors headers to flag "Non-Commercial" (CC-BY-NC) licenses, which often slip into production undetected.

It’s open source (Apache 2.0) and written in Python/Typer. Repo: https://github.com/Lab700xOrg/aisbom Live Demo (Web Viewer): https://aisbom.io

Why I built a scanner? https://dev.to/labdev_c81554ba3d4ae28317/pytorch-models-are-...

I’d love feedback on the detection logic (specifically safety.py) or if anyone has edge cases of weird Pickle protocols that break the disassembler.

rafram•1h ago
> It looks for GLOBAL or STACK_GLOBAL instructions referencing dangerous modules like os.system, subprocess, or socket.

This seems like a doomed approach. You can’t make a list of every “dangerous” function in every library.

oofbey•33m ago
Agree an explicit block list is not very robust. I imagine the vast majority of legit ML models use only a very limited set of math functions and basically no system interaction. Would be good to fingerprint a big set of assumed-safe models and flag anything which diverges from that.
lab700xdev•32m ago
You are absolutely right - blocklisting is a game of whack-a-mole. However, in the context of serialized ML weights, the "allowlist" of valid imports is actually quite small (mostly torch.nn, collections, numpy). Right now, we are flagging the obvious low-hanging fruit (script kiddie RCE) because generic SCA tools miss even that. The roadmap includes moving to a strict "Allowlist" mode where we flag any global import that isn't a known mathematical library. That’s much safer than trying to list every dangerous function
pama•1h ago
You asked for specific feedback, but here is generic feedback: a new github account coupled to a new HN account does not inspire any sense of added infra safety. I would rather use modern pytorch/safetensors and tools that dont allow executing pickles from checkpoints. If you execute someone elses pickle you probably already lost no matter what checks you want to add over time.
lab700xdev•21m ago
That is entirely fair feedback regarding the new accounts. We all have to start somewhere! That is exactly why I open-sourced the engine (Apache 2.0) and kept the logic in Python rather than a compiled binary - so you don't have to trust "me", you can audit scanner.py and safety.py yourself to see exactly how we parse the zip headers. Regarding Safetensors: I agree 100%. If everyone used Safetensors, this tool wouldn't need to exist, but looking at the Hugging Face hub, there are still millions of legacy .pt files being downloaded daily. This tool is a guardrail for the messy reality we live in, not the perfect future we want.
oofbey•36m ago
Thanks for starting to address the gap. When would this tool be best used? As a post commit hook? In the CI/CD chain? At runtime?
lab700xdev•29m ago
Ideally, CI/CD Pipeline (Pre-Merge) - We recently released a GitHub Action for this exact workflow. The goal is to block a Pull Request if a developer tries to merge a .pt file that contains CRITICAL risk opcodes. If you wait until Runtime to check, you’ve likely already unpickled the file to inspect it, which means you’re already pwnd. This needs to happen at the artifact ingestion stage (before it touches your production cluster).
woodrowbarlow•27m ago
> what security researchers call a "Pickle Bomb."

is anyone calling it that? to me, "pickle bomb" would imply abusing compression or serialization for a resource-exhaustion attack, a la zipbombs.

"pickle bomb", the way you're using it, doesn't seem like a useful terminology -- pickles are just (potentially malicious) executables.

yjftsjthsd-h•21m ago
> but blindly trust the 5GB binary model files (.pt) we download from Hugging Face.

I thought the ecosystem had mostly moved to .safetensors (which was explicitly created to fix this problem) and .gguf (which I'm pretty sure also doesn't have this problem); do you really need to download giant chunks of untrusted code and execute it at all?

chuckadams•1h ago
When dealing with stuff like php serialization and pickle, the rule is simple: never unpickle anything you didn't pickle yourself. If anything else could possibly touch the serialized bytes, sign it with HMAC and keep that somewhere untouchable.

I somehow doubt this tool is going to be able to pull off what Java bytecode verification could not.

lab700xdev•10m ago
The Golden Rule holds: "Don't unpickle untrusted data." The problem I'm trying to solve is that "Untrusted" has become blurry in the AI age. Data Scientists treat Model Hubs (like Hugging Face) as trusted repositories, similar to PyPI or NPM. They shouldn't, but they do. This tool effectively serves as a "Loud Warning Label" to break that assumption. It tells the engineer: "Hey, you think this is just weights, but I see socket calls in here. Do not load this."
woodruffw•1h ago
The checks here seem pretty minimal[1]. I'd recommend taking a look at fickling (FD: former employer) for a more general approach to pickle decompilation/analysis[2].

[1]: https://github.com/Lab700xOrg/aisbom/blob/main/aisbom/safety...

[2]: https://github.com/trailofbits/fickling

lab700xdev•6m ago
Thanks for the link! fickling is excellent work (and definitely the gold standard for deep analysis). The goal with AIsbom was to build something lightweight enough to run in a fast CI/CD loop that creates a standard inventory (CycloneDX SBOM) alongside the security check. We are definitely looking at fickling's symbolic execution approach for inspiration on how to make our safety.py module more robust against obfuscation.

Show HN: Digital Ski Bootfitter

https://wayfinderboots.com/
1•brucebotsford•50s ago•0 comments

Collaborative Web Drawing / Image Tool

http://www.multipaint.net/
1•MugCostanza•56s ago•0 comments

Automating a Browser with Anthropic's Computer Use to Play Tic-Tac-Toe [video]

https://www.youtube.com/watch?v=dFONF4PqCLw
1•cbromann•1m ago•1 comments

Dell preps price hikes up to 30% citing memory pricing 'out of our control'

https://www.tomshardware.com/laptops/dell-preps-massive-price-hikes-up-to-30-percent-citing-memor...
1•speckx•1m ago•0 comments

White Traffic Lights?

https://unionrayo.com/en/new-traffic-light-white-us/
1•josefritzishere•4m ago•1 comments

I Bet You Don't Want to Miss These AI Startup Ideas in 2026

1•alexdsouzatopg•4m ago•0 comments

The AI Sound House: A General Theory of Bangers

https://www.maximevidal.com/ai-sound-house
1•vmax1•7m ago•1 comments

Biscuit Performance Benchmark – Roaring Bitmaps

https://biscuit.readthedocs.io/en/latest/benchmark_roaring.html
1•ksec•8m ago•0 comments

Government game – a game for benchmarking systems of organization

https://theoreticalexplorer.com/Alignment+between+humans/Government+game
1•damc•8m ago•0 comments

Comparison of speed between GPT-5, GPT-5-mini, and GPT-5-nano

https://www.peterbe.com/plog/comparison-of-speed-between-gpt-5-mini-nano
1•gsky•12m ago•0 comments

Looking for an Article

1•RG1993•12m ago•1 comments

Kafka Streams Field Guide has been released

https://kafkastreamsfieldguide.com/
1•SlevinBE•13m ago•0 comments

Advanced Tech and Heart Health Top Monday's Research Schedule

https://www.nasa.gov/blogs/spacestation/2025/12/15/advanced-tech-and-heart-health-top-mondays-res...
1•ashishgupta2209•13m ago•0 comments

Show HN: Protoc-gen-dal – Generate data access converters from protobuf

https://github.com/panyam/protoc-gen-dal
1•flashgordon•13m ago•1 comments

Context: Odin's Most Misunderstood Feature

https://www.gingerbill.org/article/2025/12/15/odins-most-misunderstood-feature-context/
1•enz•14m ago•0 comments

AI hardware needs to become more brain-like to meet the growing energy demands

https://www.frontiersin.org/news/2025/12/16/how-brain-inspired-algorithms-could-overcome-ai-energ...
1•giuliomagnifico•15m ago•0 comments

America's collapsing consumption is the disenshittification opportunity

https://pluralistic.net/2025/12/16/k-shaped-recovery/
3•hn_acker•15m ago•0 comments

AI is wiping out entry-level tech jobs, leaving graduates stranded

https://restofworld.org/2025/engineering-graduates-ai-job-losses/
4•cratermoon•15m ago•2 comments

The GitHub Actions control plane is no longer free

https://www.blacksmith.sh/blog/actions-pricing
5•adityajp•15m ago•1 comments

Gemini 3 vs. GPT-5.2: Detailed Coding Comparison

https://www.tensorlake.ai/blog/gemini3-vs-gpt5-coding
2•Arindam1729•16m ago•0 comments

Sharp: High performance Node.js image processing/optimization

https://github.com/lovell/sharp
1•nateb2022•16m ago•0 comments

DoorDash launches AI social app for restaurant discovery

https://www.bloomberg.com/news/articles/2025-12-16/doordash-launches-zesty-an-ai-powered-app-for-...
2•dinosor•17m ago•1 comments

It's time to reset our expectations for AI

https://www.technologyreview.com/2025/12/16/1129946/why-its-time-to-reset-our-expectations-for-ai/
1•janandonly•17m ago•0 comments

Measuring AI's capability to accelerate biological research in the wet lab

https://openai.com/index/accelerating-biological-research-in-the-wet-lab/
1•nowflux•17m ago•0 comments

Other people might just not have your problems

https://thingofthings.substack.com/p/other-people-might-just-not-have
2•terryf•18m ago•0 comments

Paramount's $54B Debt Plays a Starring Role in Warner Bid

https://finance.yahoo.com/news/paramount-54-billion-debt-plays-220757864.html
1•indigodaddy•19m ago•0 comments

OpenCode Desktop (Beta)

https://opencode.ai/download
2•Topfi•19m ago•1 comments

Evaluating AI's ability to perform scientific research tasks

https://openai.com/index/frontierscience/
2•nowflux•19m ago•0 comments

Legup.dev – A pre-flight legal sanity check for indie builders shipping apps

https://legup.dev/
1•usernamevasile•20m ago•1 comments

GitHub will begin charging for self-hosted action runners on March 2026

https://github.blog/changelog/2025-12-16-coming-soon-simpler-pricing-and-a-better-experience-for-...
9•nklow•20m ago•1 comments