Skip to content

Add URL shortener resolution expansion - #1012

Merged
adulau merged 2 commits into
mainfrom
codex/resolve-url-shorteners
Oct 27, 2026
Merged

adulau merged 2 commits into
mainfrom
codex/resolve-url-shorteners

Conversation

@adulau

@adulau adulau commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Resolve known URL-shortener attributes into their final HTTP(S) destination with a new url_shortener expansion module. Return the original attribute and a standard shortened-link object containing the original URL, final URL, shortener hostname, and ordered redirect history. The existing object template covers this case, so no new template is required.

Follow HTTP 301/302/303/307/308 redirects using HEAD, with GET fallback on 405/501 and no response-body downloads. Support additional exact-match shortener hostnames, configurable request timeouts and redirect limits, and relative redirect locations. Normalize Unicode hostnames using non-transitional IDNA2008/UTS #46 with strict label validation, preserving the same hostname for allowlist matching, DNS, HTTP Host, and TLS. Validate every hop against all DNS answers, pin connections to a validated public address, verify TLS hostnames, and reject loops, credentials, unsafe destinations, and HTTP failures.

Includes module documentation, installation/configuration guidance, generated documentation entries, and 112 module tests.

Closes #260.

Validation:

  • python -m pytest -q tests/test_url_shortener.py tests/test_import_external_reference.py tests/test_webarchive.py — 203 passed, including regression coverage for sharp s, final sigma, UTS Make misp-modules really asynchronous #46 mapping, invalid joiners, and invalid A-labels.
  • Black, isort, flake8, strict object-template validation, module discovery, JSON validation, and git diff --check passed.
  • poetry check --lock and wheel build passed; the wheel explicitly requires idna>=3.10,<4, and existing locked package versions are unchanged.
  • DNS and HTTP responses were mocked; live shortener services and a running MISP deployment were not tested. JavaScript and HTML meta-refresh redirects are unsupported.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T10:07:20.229618Z aca7f76 PR opened
🔒 Security Review ✅ Completed 2026-10-26T10:11:31.815556Z aca7f76 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aca7f766f1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread misp_modules/modules/expansion/url_shortener.py Outdated
@adulau
adulau merged commit a2f5c61 into main Oct 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New module idea: Resolve URL shortners

1 participant