Skip to content

fix: Restrict importlib.import_module to feast.* modules in error deserialization#6447

Open
dfgvaetyj3456356-hash wants to merge 1 commit into
feast-dev:masterfrom
dfgvaetyj3456356-hash:security/fix-importlib-rce
Open

fix: Restrict importlib.import_module to feast.* modules in error deserialization#6447
dfgvaetyj3456356-hash wants to merge 1 commit into
feast-dev:masterfrom
dfgvaetyj3456356-hash:security/fix-importlib-rce

Conversation

@dfgvaetyj3456356-hash
Copy link
Copy Markdown

@dfgvaetyj3456356-hash dfgvaetyj3456356-hash commented May 28, 2026

This PR fixes a client-side remote code execution vulnerability in FeastError.from_error_detail().

CWE: CWE-94 (Code Injection)
File: sdk/python/feast/errors.py

FeastError.from_error_detail() used importlib.import_module() on an untrusted module field received from a server response. A malicious or compromised Feast server could send an error detail like {"module": "os", "class": "system", "message": "pwned"}, causing arbitrary module import and code execution on the client.

Fix: Restrict module_name to feast.* prefix only. Non-feast modules are rejected with a warning and return None.

Test: Added test_error_detail_blocks_non_feast_module() verifying that malicious non-feast modules are blocked.


Open in Devin Review

@dfgvaetyj3456356-hash dfgvaetyj3456356-hash requested a review from a team as a code owner May 28, 2026 11:40
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@dfgvaetyj3456356-hash dfgvaetyj3456356-hash changed the title security: restrict importlib.import_module to feast.* modules in error deserialization fix: Restrict importlib.import_module to feast.* modules in error deserialization May 28, 2026
Prevent arbitrary code execution when a malicious server sends a crafted error response with a non-feast module name.

The fix adds a prefix check ensuring only feast.* modules can be imported during error deserialization, with tests for non-feast rejection and legitimate feast errors.

Signed-off-by: dfgvaetyj3456356-hash <dfgvaetyj3456356-hash@users.noreply.github.com>
@dfgvaetyj3456356-hash dfgvaetyj3456356-hash force-pushed the security/fix-importlib-rce branch from f91b7f8 to 4a9ed9b Compare May 31, 2026 05:28
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