SSRF bypass in validate_safe_url when LANGCHAIN_ENV=local_test
The SSRF protection layer in langchain-core has a logic flaw: when the environment variable LANGCHAIN_ENV is set to 'local_test', any hostname that starts with 'test' and contains 'server' bypasses validation and is returned unchecked. Additionally, _effective_allowed_hosts uses startswith('local'), which unintentionally expands the allowlist for any environment value prefixed with 'local' (e.g. 'local_staging').
