Repository navigation
Conversation
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
… file Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…e protocol Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
The Origin header is parsed as scheme://host[:port] with an http or https scheme, as BootUI 2.6.0 does: a path (a trailing slash included), query, fragment, userinfo, control character, trailing colon, unsupported scheme or a port above 65535 makes the origin unreadable, and an unreadable origin is cross-site. The value is no longer trimmed.\n\nA port of more than five digits is refused before int() converts it, in the origin and in the request's own Host, so a very long port is a cross-site refusal and no longer an unhandled ValueError. Adds a property test of the origin parser. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…UI 2.6.0) A write that carries Sec-Fetch-Site must send same-origin or none (ASCII, case-insensitive); same-site, cross-site, an empty value and any unknown value are refused. A present but empty Origin header is an unreadable origin and is cross-site, no longer read as absent. A same-site navigation GET still loads the shell, and an API path still requires the request's own scheme, host and port. A request whose own origin cannot be formed stays cross-site where that comparison applies.\n\nDocuments the rule in SECURITY.md and the BootUI contract note, and records the deviations in the 0.11.0 guard matrix fragment. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Record the two deviations of the inactivity log from BootUI 2.6.0 in a matrix fragment, update the MVP plan text that still described the old log line, extract the inactivity logging of install() into a helper to keep its complexity at the pinned count, and wrap one over-long test assertion. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
An invalid SHARPIT_ENABLED must log exactly one record, the fixed warning, as BootUI does. The count of the remaining configuration warnings stays. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
An invalid SHARPIT_ENABLED is already reported by the fixed inactive warning. Counting its settings warning as well produced a second WARNING record, where BootUI logs one. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…tests Port BootUiInactiveStartupDiagnosticTests.deliberateDisablementIsSilentAtInfo, cite the BootUI tests the other inactivity tests port, and keep the expected log texts in one test module. A single Inactivity alias types the inactivity category. The matrix row for the warning count records that it leaves out the invalid SHARPIT_ENABLED warning. Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com> # Conflicts: # tests/fuzz/test_trust_boundary_fuzz.py
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…token Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
…ootUI's URI rules Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Task 1.5 of the 0.11.0 plan (#367): the GitHub remote detector reads repository metadata within fixed limits and
parses remotes with BootUI 2.6.0's rules (
GitHubRepositoryDetector).src/sharpit/engine/collectors/github/detector.py:.gitfile,commondirandHEAD8192 bytes; the walk stops at 64 levels;invalid UTF-8 is decoded with replacement, as BootUI does;
/and one.gitare removed; a rawquery or fragment, even an empty one, is rejected;
java.net.URIrejects (whitespace, control characters,\ " < > ^{ | }, a second@in the authority, a malformed percent escape) are rejected explicitly, sinceurllib.parse.urlsplitaccepts them; a host outside the hostname grammar gives "No GitHub origin remote was detected", as a nullgetHost()` does in BootUI;gitdir:pointer to a UNC or device path stops the walk before any filesystem call on it; an empty pointerresolves to its own folder (BootUI
readGitDirFile); neither falls through to an enclosing repository;Remotesanddetect_remotes()report origin and upstream with BootUI's upstream reason text (used by Task 1.8).src/sharpit/engine/collectors/github/token.py: the credential host is trimmed as Java trims; a remote host or aGH_HOSTvalue containing a control character (other than ASCII whitespace padding) resolves no token.docs/reference/matrix-updates/0.11.0-github.tsv: rowsgithub.detector.unc-pointer,github.detector.percent-encoding,github.detector.uri-characters,github.token.control-chars.Review scope
This branch was cut from the 0.11.0 integration line, so against
mainthe diff also shows the changes of the earlier 0.11.0 pull requests (Wave 0, #368 to #376, and the S1 and S11 fixes). Those merge first; the changes of this pull request are the commits afterMerge branch 'release/0.11.0' into feat/0.11.0-github-detector, insrc/sharpit/engine/collectors/github/,tests/engine/collectors/github/anddocs/reference/matrix-updates/0.11.0-github.tsv.Red evidence
Each test was run against the code before its fix (
scripts/dev/red_check.py, or the earlier source restored in theworktree); every red below is an assertion.
https://github.com/a/b/extraand trailing-slash forms were judged bylen < 2test_detector_rejects_malformed_origin_remotes, trailing-slash cases?or#passedurlsplittest_detector_rejects_malformed_origin_remotes[...?]\,{, `, a second@, NBSP,\x01` in a remote were acceptedtest_detector_rejects_malformed_origin_remotes[...]test_detector_rejects_malformed_origin_remotes[https://x%zz@github.com/team/service]test_detector_rejects_host_outside_uri_hostname_grammartest_detector_decodes_non_utf8_config_comments_with_replacementgitdir:pointer fell through to an enclosing repositorytest_unsafe_gitdir_pointer_does_not_fall_through_to_enclosing_repository[...](3 cases)outer/reporeturnedtest_a_host_gh_could_misread_resolves_nothing[...]GH_HOSTwith a leading control character bound the enterprise tokenGH_HOSTcontrol-character caseTwo added cases were already green before their fix and stay as guards: a malformed escape inside a path segment
(rejected by the segment rule) and the prefix-only UNC guard in
test_gitdir_unc_pointer_is_not_resolved.Deviations from BootUI
github.detector.unc-pointer(safety model over parity): a UNC or devicegitdir:target is refused before anyfilesystem call. Known limits: a
.gitsymlink or junction, a relative pointer through a symlinked directory and amapped network drive letter are not covered.
github.token.control-chars: a host string with a control character resolves no token; BootUI trims and accepts it.github.detector.uri-characters: explicit rejection of whatjava.net.URIrejects (Python's parser is laxer).github.detector.percent-encoding: percent-encoded path segments are refused.Verification
uv run ruff check(All checks passed),uv run ruff format --check(1395 files already formatted),uv run pyright(0 errors);
uv run pytest -q -n 4 tests/engine/collectors/github tests/fastapi -k github(249 passed);tests/test_code_shape.py tests/test_ported_citations.py tests/safety/test_w7_github_safety.py(10 passed). The fullsuite runs in CI.