Skip to content

Commit 82e28e2

Browse files
committed
fix(starter): default trust_remote_code to false for sentence-transformers
The starter distribution set trust_remote_code: true for the sentence-transformers embedding provider, so loading any model from the HuggingFace Hub would execute code bundled with that repository. A compromised or malicious model could use this to run arbitrary code on the OGX server. The starter distribution is the template most new deployments copy, so it should use the secure default that the config class itself documents. Restore trust_remote_code: false and regenerate the distribution configs; deployments that need remote code for a specific model can still opt in per provider. Closes #6311. Signed-off-by: Yash Anil <yashanil98@gmail.com>
1 parent 189de74 commit 82e28e2

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/ogx/distributions/starter/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ providers:
9898
- provider_id: sentence-transformers
9999
provider_type: inline::sentence-transformers
100100
config:
101-
trust_remote_code: true
101+
trust_remote_code: false
102102
vector_io:
103103
- provider_id: faiss
104104
provider_type: inline::faiss

src/ogx/distributions/starter/run-with-postgres-store.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ providers:
9898
- provider_id: sentence-transformers
9999
provider_type: inline::sentence-transformers
100100
config:
101-
trust_remote_code: true
101+
trust_remote_code: false
102102
vector_io:
103103
- provider_id: faiss
104104
provider_type: inline::faiss

src/ogx/distributions/starter/starter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def get_distribution_template(name: str = "starter") -> DistributionTemplate:
171171
embedding_provider = Provider(
172172
provider_id="sentence-transformers",
173173
provider_type="inline::sentence-transformers",
174-
config=SentenceTransformersInferenceConfig(trust_remote_code=True).model_dump(),
174+
config=SentenceTransformersInferenceConfig(trust_remote_code=False).model_dump(),
175175
)
176176
responses_provider = Provider(
177177
provider_id="builtin",

0 commit comments

Comments
 (0)