Sh Kb File Upload logo

Sh Kb File Upload

Community
dmdhrumilmistry
sh-kb-file-upload

Knowledge base for finding unrestricted/insecure file upload - uploads that allow dangerous file types, execution in the upload dir, path control over the stored name, or missing content validation, leading to RCE, XSS, or overwrite. Use when hunting file-upload issues. CWE-434/436/616, OWASP A04/A05:2021.

Overview

Publisherdmdhrumilmistry
Repositorysecurity-harness
Skill namesh-kb-file-upload
Stars
42
Forks
11
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dmdhrumilmistry on GitHub. Read the source before you install it.

Installation

Install the Sh Kb File Upload AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-file-upload
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dmdhrumilmistry/security-harness.git /tmp/security-harness
mkdir -p .claude/skills
cp -r /tmp/security-harness/plugins/security-harness/skills/sh-kb-file-upload .claude/skills/sh-kb-file-upload
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sh Kb File Upload in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sh Kb File Upload on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sh Kb File Upload is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Unrestricted File Upload - Hunter Knowledge Base

Uploads become dangerous when the app trusts the client-provided type/name, stores files where they can be executed or served, or skips content validation. Worst case: upload a web shell and get RCE.

What to hunt

  • Executable upload + reachable path (CWE-434): uploading .php/.jsp/.aspx/.py (or a bypass variant) into a directory the web server executes -> RCE.
  • Type/extension trust: validating only the client Content-Type or extension (spoofable); no server-side content/magic-byte check.
  • Path control over stored name: attacker sets the filename/path (traversal ../, overwrite of an existing file, null byte, double extension shell.php.jpg, trailing dot/space, case tricks, NTFS Alternate Data Stream shell.asp:.jpg, or a name like shell.p.phphp that becomes shell.php after a single-pass, non-recursive strip of a blacklisted extension).
  • Upload-then-validate race window: the app writes the file to a web-reachable path first and deletes it afterward if validation fails - an attacker who requests the file fast enough (or repeatedly re-uploads to widen the window) can get it executed before it's removed.
  • Content-driven XSS / SVG / HTML / polyglot: uploading .svg/.html served inline on the app origin -> stored XSS; image polyglots; .xml-backed formats -> XXE.
  • Missing limits: no size/rate limit -> DoS; zip-bomb; decompression bombs.
  • Metadata/EXIF or antivirus gaps; server-side image processing (ImageMagick "ImageTragick") RCE.

Sinks / patterns (grep targets)

Upload handlers and where they write: request.files, MultipartFile, multer, formidable, move_uploaded_file, save(/saveAs(, fs.writeFile(uploadPath), os.path.join(upload_dir, filename), secure_filename (Flask - check it's actually used), Content-Type checks, extension allowlist/denylist. Also how the file is later served (static route over the upload dir) or processed (image libs).

Detection recipe

  1. graft grep "request.files|MultipartFile|multer|move_uploaded_file|save(|writeFile|upload" --json.
  2. For each upload: How is the type validated (extension? content-type? magic bytes?). Is the stored name attacker-controlled? Where is it stored, and is that path executable or served inline on the app origin?
  3. Trace the stored filename for traversal/overwrite; check size/count limits.

Payloads / PoC

  • Web shell: shell.php with <?php system($_GET['c']); ?> if PHP execution reachable; .jsp/.aspx equiv.
  • Bypasses: double extension shell.php.jpg, null byte shell.php%00.jpg, case shell.PhP, trailing dot/space shell.php., spoofed Content-Type: image/png with PHP body, magic-byte prefix + code, alternative interpreter extensions often missing from blacklists (.phtml, .php5, .pht, .shtml, .asp;.aspx), URL-encoded extension exploit%2Ephp, polyglot image+payload files (e.g. built with ExifTool) that pass magic-byte/dimension checks.
  • Stored XSS: upload poc.svg containing <script>...</script> or poc.html, served inline.
  • Traversal/overwrite: filename ../../app/config.py (zip-slip for archives).
  • PoC: upload the file, then request its served URL and observe execution/script/overwrite.

False-positive filters

  • Server-side content validation (magic bytes / re-encode image) and an extension allowlist (not denylist), with a server-generated random stored name (client name discarded).
  • Uploads stored outside the webroot / on object storage with Content-Disposition: attachment and a non-executing content-type, served from a separate origin/domain.
  • Size/count/rate limits enforced; archives validated before extraction.
  • Validation happens before the file is written to any web-reachable path (no upload-then-delete-on-fail race window).
  • Per-directory config overrides disabled (Apache AllowOverride None, IIS handler mappings locked) so a smuggled .htaccess/web.config in the upload dir can't grant execution; on Windows, 8.3 short-filename generation disabled (fsutil behavior set disable8dot3 1) so a blocked long name can't be reached via its short alias.

CWE / OWASP / severity

CWE-434 (unrestricted upload), CWE-436 (interpretation conflict), CWE-616. OWASP A04/A05:2021. Upload->RCE -> critical; stored XSS via upload -> high; overwrite/DoS -> per impact.

Chaining hints

Upload web shell -> RCE -> secrets/lateral (chain terminus); SVG/HTML upload -> stored xss -> admin takeover; filename control -> path-traversal overwrite; XML-backed upload -> xxe; feeds injection (processing the file with a shell).

Mitigation

Allowlist expected extensions and validate content (magic bytes / re-encode images) before the file touches any web-reachable path; discard the client filename and generate a random server-side name; store outside the webroot or on object storage served from a separate origin with Content-Disposition: attachment and a safe content-type; disable per-directory config overrides and short-filename generation; enforce size/count/rate limits; scan for malware; keep image-processing libraries patched.

Frequently asked questions

What does the Sh Kb File Upload AI skill do?

Knowledge base for finding unrestricted/insecure file upload - uploads that allow dangerous file types, execution in the upload dir, path control over the stored name, or missing content validation, leading to RCE, XSS, or overwrite. Use when hunting file-upload issues. CWE-434/436/616, OWASP A04/A05:2021.

Why use Sh Kb File Upload on TypingMind?

Because you install it once and use it with any model. Sh Kb File Upload is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sh Kb File Upload in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dmdhrumilmistry/security-harness/tree/main/plugins/security-harness/skills/sh-kb-file-upload. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Sh Kb File Upload?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sh Kb File Upload?

As many as you like. As long as a model supports skills, you can use Sh Kb File Upload with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sh Kb File Upload AI skill free?

Yes. It is published on GitHub by dmdhrumilmistry under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇