-
Notifications
You must be signed in to change notification settings - Fork 0
fix(security): resolve high CodeQL sanitizer findings #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| from datetime import datetime, timezone | ||
| from pathlib import Path | ||
| from typing import Any | ||
| from urllib.parse import urlparse | ||
|
|
||
| from src.notion_registry import load_notion_project_context | ||
| from src.portfolio_catalog import group_entry_for_path | ||
|
|
@@ -415,10 +416,11 @@ def _extract_github_full_name(remote_url: str) -> str: | |
| cleaned = cleaned[:-4] | ||
| if cleaned.startswith("[email protected]:"): | ||
| cleaned = cleaned.split("[email protected]:", 1)[1] | ||
| elif "github.com/" in cleaned: | ||
| cleaned = cleaned.split("github.com/", 1)[1] | ||
| else: | ||
| return "" | ||
| parsed = urlparse(cleaned) | ||
| if parsed.hostname != "github.com": | ||
| return "" | ||
| cleaned = parsed.path.lstrip("/") | ||
| parts = [part for part in cleaned.split("/") if part] | ||
| if len(parts) < 2: | ||
| return "" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |
| from src.portfolio_truth_publish import publish_portfolio_truth | ||
| from src.portfolio_truth_reconcile import build_portfolio_truth_snapshot | ||
| from src.portfolio_truth_render import render_registry_markdown | ||
| from src.portfolio_truth_sources import _classify_context_quality | ||
| from src.portfolio_truth_sources import _classify_context_quality, _extract_github_full_name | ||
| from src.registry_parser import parse_registry | ||
|
|
||
|
|
||
|
|
@@ -34,6 +34,12 @@ def _set_mtime(path: Path, timestamp: float) -> None: | |
| os.utime(path, (timestamp, timestamp)) | ||
|
|
||
|
|
||
| def test_extract_github_full_name_uses_exact_github_host() -> None: | ||
| assert _extract_github_full_name("https://github.com/octo/repo.git") == "octo/repo" | ||
| assert _extract_github_full_name("[email protected]:octo/repo.git") == "octo/repo" | ||
| assert _extract_github_full_name("https://evil.example/github.com/octo/repo.git") == "" | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def portfolio_workspace(tmp_path: Path) -> Path: | ||
| workspace = tmp_path / "workspace" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an output directory already contains campaign approval records from the previous release, those records store the 40-character SHA-1 fingerprint generated from the same
material. Switching the current fingerprint to SHA-256 makes unchanged packets compare unequal in_campaign_record, so previously approved campaigns are reported asneeds-reapprovaland any apply flow that depends onapproved-manualis blocked until users re-approve every campaign after upgrade. Consider accepting/migrating legacy SHA-1 fingerprints while emitting SHA-256 for new approvals.Useful? React with 👍 / 👎.