URLDataTypeSerializer treats mixed-case HTTP(S) schemes as local paths

Open Beginner friendly
#3,861 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@akhil9tiet is already working on this.

Since Nov 3, 2026.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python, sqlite
Domain
data

Research direction

Start at the URLDataTypeSerializer class and its case-sensitive prefix check that decides between URL and local path. Reproduce with the synthetic HTTPS://example.invalid/é?q=☃ value through hashing and add_seeds_to_memory_async on an in-memory SQLite memory. Done when http and https are matched case-insensitively, the original URL spelling is kept for the hash input, and local paths still behave as before.

Written by the indexing model from the issue text.

Description

Bug: triage help wanted
Describe the bug

URLDataTypeSerializer uses a case-sensitive prefix check to decide whether a value is a URL or a local path. HTTPS://... and HtTp://... are valid HTTP(S) URLs, but are classified as files. Hashing and public seed ingestion then raise FileNotFoundError.

Steps/Code to Reproduce

Use a SQLiteMemory and URLDataTypeSerializer with the synthetic URL HTTPS://example.invalid/é?q=☃, then hash it or pass it to add_seeds_to_memory_async. No URL needs to be fetched.

Expected Results

Recognize http and https schemes case-insensitively while preserving the original URL spelling and hash input; continue handling local paths normally.

Actual Results

Lowercase https:// hashes and ingests successfully. Uppercase and mixed-case schemes set data_on_disk=true; both operations raise FileNotFoundError for the URL string treated as a path.

Screenshots

N/A. SDK and local SQLite reproduction; no external URL was fetched.

Versions

Linux; Python 3.12.3; PyRIT 1.2.0.dev0 at revision 01ce6ca66a315770b36c7dca1f320668c0d92d7c. Real SDK and in-memory SQLite; no network fetch or model call.

Dominant language
Python
Stars
4.7k
Forks
1k
Avg merge
2d 3h
Merged PRs (30d)
465

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/PyRIT

All issues in microsoft/PyRIT

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.