FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Day 13 — I Stopped Trusting File Names and Started Inspecting Files (SafeOpen v2)
NewsSystems

Day 13 — I Stopped Trusting File Names and Started Inspecting Files (SafeOpen v2)

via Dev.toHafiz Shamnad1mo ago

Yesterday my tool only looked at the filename. Today I realised the filename is the lie attackers want you to believe. The Moment Everything Changed I took a harmless malicious.bat and renamed it to invoice.pdf . My old checker (Day 12) said: “Looks safe ✅” Windows Explorer showed: invoice.pdf (icon = PDF) A normal user would double-click without a second thought. But the file was still a batch script. That’s when it hit me: The operating system doesn’t execute the name. It executes the content. Files Have Two Identities What the user sees → filename + icon (easy to fake) What the OS executes → magic bytes (first 2–8 bytes of the file) Real examples: PDF → always starts with %PDF Windows EXE → always starts with MZ ELF binary (Linux) → starts with 7f ELF ZIP (DOCX, XLSX, JAR…) → starts with PK\x03\x04 If the header says “executable” but the name says “document”, that’s a disguise . Game over for filename-only checkers. So I rebuilt everything. SafeOpen v2 — “Inspect Before You Execute”

Continue reading on Dev.to

Opens in a new tab

Read Full Article
31 views

Related Articles

The Outbox Pattern: A Consistent Approach to Distributed Transactions
News

The Outbox Pattern: A Consistent Approach to Distributed Transactions

Medium Programming • 3d ago

6o6 v1.1: Faster 6502-on-6502 virtualization for a C64/Apple II Apple-1 emulator
News

6o6 v1.1: Faster 6502-on-6502 virtualization for a C64/Apple II Apple-1 emulator

Lobsters • 3d ago

ChemBERTa-2: Towards Chemical Foundation Models
News

ChemBERTa-2: Towards Chemical Foundation Models

Dev.to • 3d ago

Test title
News

Test title

Dev.to Tutorial • 3d ago

Legacy PC design misery
News

Legacy PC design misery

Lobsters • 3d ago

Discover More Articles