๐—›๐—ฎ๐—ฟ๐—ฑ๐—ฒ๐—ป๐—ถ๐—ป๐—ด ๐—”๐—ฃ๐—œ ๐—ฆ๐—ฐ๐—ฎ๐—ป ๐—•๐—ผ๐˜‚๐—ป๐—ฑ๐—ฎ๐—ฟ๐—ถ๐—ฒ๐˜€

API security is not just about protecting a database. When an API can scan local files, extract ZIP archives, and run heavy LLM tasks, the attack surface grows fast.

I recently worked on hardening the skill-scanner repository. I did not rely on gut feeling. I used a code graph tool called sqry to map out exactly how data flows through the system.

The goal was simple: stop a single API request from turning into arbitrary filesystem access or a resource exhaustion attack.

Here is how I approached the hardening process:

The most important lesson came from the graph. A manual read might focus on the API router. However, the graph showed that the "SkillLoader" had 92 direct callers across the CLI, API, and tests.

If you only fix the API, you leave 91 other paths open. I moved the security boundaries down into the core loader so every caller stays within safe limits.

Specific changes I implemented:

Stop reviewing code by looking at one file at a time. Use text search for strings, but use AST and graph search to understand structure.

If a piece of code is shared, its security limits must be shared too.

Source: https://dev.to/wernerk_au/hardening-api-scan-boundaries-in-skill-scanner-with-sqry-as-the-review-map-dip

Optional learning community: https://t.me/GyaanSetuAi