Skip to content

sync: mirror from thyn-ai/codna@8c99e8e14e3db9cc33d8d3d65227dcb2c622d344 - #42

Closed
0xamlab wants to merge 1 commit into
mainfrom
sync/8c99e8e14e3db9cc33d8d3d65227dcb2c622d344
Closed

0xamlab wants to merge 1 commit into
mainfrom
sync/8c99e8e14e3db9cc33d8d3d65227dcb2c622d344

Conversation

@0xamlab

@0xamlab 0xamlab commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Automated mirror of cli/ (flattened), the root allowlist (server.json, glama.json, LICENSE, .gitleaks.toml) and the public-root/ community tree from thyn-ai/codna at 8c99e8e14e3db9cc33d8d3d65227dcb2c622d344. Merges itself via auto-merge once the mirror's required checks (codna review, Analyze (python)) pass and the codna-ai review approves; if a later sync lands first, this PR is closed as superseded -- every sync PR is a full snapshot of the exported surface.

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Thanks for opening your first pull request in the Codna CLI! Please make sure the checks are green and that the change follows CONTRIBUTING.md. A maintainer will review it shortly.

@0xamlab

0xamlab commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #43 (a later thyn-ai/codna commit). Every sync PR is a full snapshot of the exported surface, so this one carries nothing #43 does not. Closing.

@0xamlab 0xamlab closed this Nov 5, 2026
auto-merge was automatically disabled November 5, 2026 05:49

Pull request was closed

@0xamlab
0xamlab deleted the sync/8c99e8e14e3db9cc33d8d3d65227dcb2c622d344 branch November 5, 2026 05:49

@codna-ai codna-ai 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.

codna review — 2 finding(s): 2 inline, 0 in summary.

Reply @codna fix on a finding to have Codna open a verified, test-green, risk-gated fix PR.

⏸ Not approved: 1 medium/high finding(s) in this review.

Comment thread codna/config_file.py
Comment on lines +131 to +137
if parts.username or parts.password:
raise ConfigError(f"{field} must not embed credentials")
if parts.query or parts.fragment:
raise ConfigError(f"{field} must not carry a query string or fragment")
path = parts.path.rstrip("/")
netloc = parts.netloc
return f"{parts.scheme}://{netloc}{path}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 MEDIUM · security — Empty username bypasses embedded-credential check in _validated_base_url

Python's urlsplit sets parts.username to the empty string "" (not None) when a URL contains a bare @ with no actual username, e.g. https://@host/path. The condition if parts.username or parts.password evaluates "" or None → None (falsy), so the check does not raise ConfigError. The function then proceeds to line 136 where netloc = parts.netloc is "@host", and the reconstructed URL is returned as https://@host — a URL that embeds userinfo syntax and can confuse downstream HTTP clients (some interpret an empty username as an authentication hint). The docstring explicitly promises to "fail-closed on every shape that could smuggle something past the consumer", but this shape slips through.

Suggested change
if parts.username or parts.password:
raise ConfigError(f"{field} must not embed credentials")
if parts.query or parts.fragment:
raise ConfigError(f"{field} must not carry a query string or fragment")
path = parts.path.rstrip("/")
netloc = parts.netloc
return f"{parts.scheme}://{netloc}{path}"
Replace the credential check with a check on `parts.userinfo` (which is non-empty for any `@`-containing netloc) or use `if parts.username is not None or parts.password is not None:` — but the safest fix is to test whether the netloc contains `@` at all:
```python
# replace lines 131-132 with:
if parts.username is not None or parts.password is not None:
raise ConfigError(f"{field} must not embed credentials")

or equivalently:

if '@' in parts.netloc:
    raise ConfigError(f"{field} must not embed credentials")

_Reply `@codna fix` and Codna opens a verified, test-green, risk-gated fix PR._

<!-- codna:review:fp=52821c2046a62929 -->
<!-- codna:finding eyJmcCI6ICI1MjgyMWMyMDQ2YTYyOTI5IiwgInBhdGgiOiAiY29kbmEvY29uZmlnX2ZpbGUucHkiLCAibGluZSI6IDEzMSwgImVuZF9saW5lIjogMTM3LCAic2V2ZXJpdHkiOiAibWVkaXVtIiwgImNhdGVnb3J5IjogInNlY3VyaXR5IiwgInRpdGxlIjogIkVtcHR5IHVzZXJuYW1lIGJ5cGFzc2VzIGVtYmVkZGVkLWNyZWRlbnRpYWwgY2hlY2sgaW4gX3ZhbGlkYXRlZF9iYXNlX3VybCIsICJleHBsYW5hdGlvbiI6ICJ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io": ">=1.34,<2",
"langgraph": ">=1,<2",
"langchain-core": ">=1,<2",
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚪ LOW · correctness — DURABLE_RANGES missing entry for langgraph-checkpoint

DURABLE_PINS has four entries including langgraph-checkpoint (minimum=(4,), maximum=(5,)), but DURABLE_RANGES only has three entries — "langgraph-checkpoint" is absent. In require_durable() the range is looked up with DURABLE_RANGES.get(requirement.distribution, ""), so when an unsupported version of langgraph-checkpoint is installed, the error details field "range" is "" instead of ">=4,<5". The comment states the dict mirrors the pyproject extra and is asserted equal by tests; the missing entry means that assertion would also be incomplete for this package, so a version-window change could go undetected.

Suggested change
DURABLE_RANGES: Final[dict[str, str]] = {
"temporalio": ">=1.34,<2",
"langgraph": ">=1,<2",
"langchain-core": ">=1,<2",
}
Add the missing entry to DURABLE_RANGES:
```python
DURABLE_RANGES: Final[dict[str, str]] = {
"temporalio": ">=1.34,<2",
"langgraph": ">=1,<2",
"langchain-core": ">=1,<2",
"langgraph-checkpoint": ">=4,<5", # add this line
}

_Reply `@codna fix` and Codna opens a verified, test-green, risk-gated fix PR._

<!-- codna:review:fp=1b72456306330577 -->
<!-- codna:finding eyJmcCI6ICIxYjcyNDU2MzA2MzMwNTc3IiwgInBhdGgiOiAiY29kbmEvZHVyYWJsZS9fX2luaXRfXy5weSIsICJsaW5lIjogMTAyLCAiZW5kX2xpbmUiOiAxMDYsICJzZXZlcml0eSI6ICJsb3ciLCAiY2F0ZWdvcnkiOiAiY29ycmVjdG5lc3MiLCAidGl0bGUiOiAiRFVSQUJMRV9SQU5HRVMgbWlzc2luZyBlbnRyeSBmb3IgbGFuZ2dyYXBoLWNoZWNrcG9pbnQiLCAiZXhwbGFuYXRpb24iOiAiYERVUkFCTEVfUElOU2AgaGFzIGZvdXIgZW50cmllcyBpbmNsdWRpbmcgYGxhbmdncmFwaC1jaGVja3BvaW50YCAobWluaW11bT0oNCwpLCBtYXhpbXVtPSg1LCkpLCBidXQgYERVUkFCTEVfUkFOR0VTYCBvbmx5IGhhcyB0aHJlZSBlbnRyaWVzIFx1MjAxNCBgXCJsYW5nZ3JhcGgtY2hlY2twb2ludFwiYCBpcyBhYnNlbnQuIEluIGByZXF1aXJlX2R1cmFibGUoKWAgdGhlIHJhbmdlIGlzIGxvb2tlZCB1cCB3aXRoIGBEVVJBQkxFX1JBTkdFUy5nZXQocmVxdWlyZW1lbnQuZGlzdHJpYnV0aW9uLCBcIlwiKWAsIHNvIHdoZW4gYW4gdW5zdXBwb3J0ZWQgdmVyc2lvbiBvZiBgbGFuZ2dyYXBoLWNoZWNrcG9pbnRgIGlzIGluc3RhbGxlZCwgdGhlIGVycm9yIGRldGFpbHMgZmllbGQgYFwicmFuZ2VcImAgaXMgYFwiXCJgIGluc3RlYWQgb2YgYFwiPj00LDw1XCJgLiBUaGUgY29tbWVudCBzdGF0ZXMgdGhlIGRpY3QgbWlycm9ycyB0aGUgcHlwcm9qZWN0IGV4dHJhIGFuZCBpcyBhc3NlcnRlZCBlcXVhbCBieSB0ZXN0czsgdGhlIG1pc3NpbmcgZW50cnkgbWVhbnMgdGhhdCBhc3NlcnRpb24gd291bGQgYWxzbyBiZSBpbmNvbXBsZXRlIGZvciB0aGlzIHBhY2thZ2UsIHNvIGEgdmVyc2lvbi13aW5kb3cgY2hhbmdlIGNvdWxkIGdvIHVuZGV0ZWN0ZWQuIn0= -->

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