The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(flows): refuse stored http credentials over plain http to remote hosts
M3gA-Mind465298949dee
diff --git a/crates/openhuman-core/src/flows/caps_host/http.rs b/crates/openhuman-core/src/flows/caps_host/http.rsindex 0498629015..0c2d5b5a02 100644--- a/crates/openhuman-core/src/flows/caps_host/http.rs+++ b/crates/openhuman-core/src/flows/caps_host/http.rs@@ -109,6 +109,30 @@ pub(crate) fn resolve_http_credential(}}+/// Refuse a request that would carry a stored credential over plain HTTP to a+/// remote host. Only `https` and loopback `http` are allowed; an unparsable or+/// missing URL fails closed.+pub(crate) fn refuse_credential_over_plain_http(request: &Value) -> Result<()> {+ let url = request+ .get("url")+ .and_then(Value::as_str)+ .unwrap_or_default();+ let https = url::Url::parse(url).is_ok_and(|parsed| parsed.scheme() == "https");+ if https || crate::integrations::composio::client::is_loopback_http_url(url) {+ return Ok(());+ }+ tracing::warn!(+ target: "flows",+ "[flows] http_request: refusing to send a stored credential over plain http to a \+ non-loopback host"+ );+ Err(EngineError::Capability(+ "http_request refuses to send a stored credential over plain http to a non-loopback \+ host; use https"+ .to_owned(),+ ))+}+impl OpenHumanHttp {pub(crate) async fn request(&self, mut request: Value, conn: Option<&str>) -> Result<Value> {const TOOL_NAME: &str = "flows_http_request";@@ -138,6 +162,12 @@ impl OpenHumanHttp {.await.map_err(|error| EngineError::Capability(error.to_string()))?;+ // Check before the approval prompt and before any dispatch, so a request+ // that can never be sent safely is neither prompted for nor attempted.+ if inspected.credential_name.is_some() {+ refuse_credential_over_plain_http(&request)?;+ }+// The approval gate summarizes/redacts the request BEFORE any credential// is injected, so a stored secret never lands in the approval UI or// audit trail. Injection happens strictly after this point.diff --git a/crates/openhuman-core/src/flows/caps_host/http_tests.rs b/crates/openhuman-core/src/flows/caps_host/http_tests.rsindex 74eba30040..164f0c1ef9 100644--- a/crates/openhuman-core/src/flows/caps_host/http_tests.rs+++ b/crates/openhuman-core/src/flows/caps_host/http_tests.rs@@ -18,3 +18,18 @@ fn credential_resolution_fails_closed_for_empty_or_unknown_names() {assert!(resolve_http_credential(&store, Some(" ")).is_err());assert!(resolve_http_credential(&store, Some("missing")).is_err());}++#[test]+fn a_stored_credential_is_refused_over_plain_http_to_a_remote_host() {+ let refused = |url: &str| refuse_credential_over_plain_http(&json!({ "url": url })).is_err();+ // Remote plain http, including userinfo smuggling a loopback-looking prefix.+ assert!(refused("http://api.example.com/v1"));+ assert!(refused("http://127.0.0.1:[email protected]/v1"));+ assert!(refused("not a url"));+ assert!(refuse_credential_over_plain_http(&json!({})).is_err());+ // https anywhere, and plain http to loopback, still go through.+ assert!(!refused("https://api.example.com/v1"));+ assert!(!refused("http://127.0.0.1:8080/v1"));+ assert!(!refused("http://localhost/v1"));+ assert!(!refused("http://[::1]:9000/v1"));+}diff --git a/crates/openhuman-core/src/integrations/composio/client.rs b/crates/openhuman-core/src/integrations/composio/client.rsindex f56bbc2a78..9e64c31f27 100644--- a/crates/openhuman-core/src/integrations/composio/client.rs+++ b/crates/openhuman-core/src/integrations/composio/client.rs@@ -19,6 +19,8 @@ mod network;#[path = "client_tests.rs"]mod tests;+#[cfg(feature = "flows")]+pub(crate) use credential::is_loopback_http_url;pub use credential::DirectCredential;pub use direct::direct_list_connections;#[cfg(test)]diff --git a/crates/openhuman-core/src/integrations/composio/client/credential.rs b/crates/openhuman-core/src/integrations/composio/client/credential.rsindex 44c151f3ad..a7961cd90e 100644--- a/crates/openhuman-core/src/integrations/composio/client/credential.rs+++ b/crates/openhuman-core/src/integrations/composio/client/credential.rs@@ -12,7 +12,7 @@ use tinyconnectors_bus::ComposioDirectCredential;/// URL, so a credential on it sends no override.const COMPOSIO_API_BASE_V3: &str = "https://backend.composio.dev/api/v3";-pub(super) fn is_loopback_http_url(url: &str) -> bool {+pub(crate) fn is_loopback_http_url(url: &str) -> bool {// Parse rather than prefix-match: a raw `starts_with("http://127.0.0.1:")`// is fooled by userinfo smuggling like// `http://127.0.0.1:[email protected]/api/v3/tools`, which an HTTP client routes