Skip to content

fix: require HTTPS for remote file reads - #83

Merged
jbdevprimary merged 1 commit into
mainfrom
codex/regex-hardening
Aug 24, 2026
Merged

fix: require HTTPS for remote file reads#83
jbdevprimary merged 1 commit into
mainfrom
codex/regex-hardening

Conversation

@jbdevprimary

Copy link
Copy Markdown
Contributor

Summary

  • make the remote file boundary HTTPS-only
  • reject HTTP and unsupported schemes before creating a request
  • document the encrypted-transport requirement in Sourcey

Validation

  • tox -e lint,typecheck,py311,py312,py313,py314,examples,docs,build,audit (818 passed per interpreter; 95% coverage)
  • pnpm --dir docs validate
  • actionlint .github/workflows/*.yml

@jbdevprimary
jbdevprimary enabled auto-merge August 24, 2026 17:24
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 5 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 43078cff-380f-400f-947a-51a6b0fe0ece

📥 Commits

Reviewing files that changed from the base of the PR and between 99505f9 and 5204409.

📒 Files selected for processing (3)
  • docs/core/workflows.md
  • packages/extended-data/src/extended_data/io/files.py
  • packages/extended-data/tests/core/test_file_data_type.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@amazon-q-developer amazon-q-developer 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.

The security hardening changes to enforce HTTPS-only for remote file reads are well-implemented. The PR correctly restricts the is_url() function to only accept HTTPS URLs, adds early validation to reject non-HTTPS schemes before making network requests, updates documentation to reflect the new requirement, and includes comprehensive test coverage for the changes. The implementation follows a defense-in-depth approach by validating URLs at multiple layers. No blocking issues identified.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@sonarqubecloud

Copy link
Copy Markdown

@jbdevprimary
jbdevprimary merged commit a3f2bf2 into main Aug 24, 2026
18 checks passed
@jbdevprimary
jbdevprimary deleted the codex/regex-hardening branch August 24, 2026 17:25

@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: 520440986b

ℹ️ 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 on lines +462 to +463
if "://" in path_str and not is_url(path_str):
raise ValueError("Remote file URLs must use HTTPS")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject clear-text redirect targets

When an accepted HTTPS endpoint responds with a redirect whose Location uses http://, the default urllib.request.urlopen redirect handler creates and follows that request without re-running this guard; it also carries the supplied custom headers into the redirected request. Consequently, both the response and potentially sensitive headers can still travel over clear text despite the newly documented HTTPS-only boundary. Use an opener/redirect handler that rejects every non-HTTPS redirect target.

AGENTS.md reference: AGENTS.md:L77-L77

Useful? React with 👍 / 👎.

Comment on lines +462 to +463
if "://" in path_str and not is_url(path_str):
raise ValueError("Remote file URLs must use HTTPS")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve Windows paths containing doubled separators

On Windows, callers can validly pass a string such as C://Users/me/config.json, which Path normally resolves as an absolute local path. The new substring check instead treats any :// as evidence of a remote URL; because is_url rejects the c scheme, read_file now raises ValueError before local-path resolution. Detect an actual URI scheme without misclassifying drive-letter paths.

Useful? React with 👍 / 👎.

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.

1 participant