Skip to content

Conversation

@elbamit
Copy link
Contributor

@elbamit elbamit commented Oct 16, 2025

📝 Description

This PR ensures that the following (false positive, see related Jira ticket) vulnerability https://github.com/mlrun/mlrun/security/code-scanning/135 will not happen. It will raise a runtimeError if changed.

The PR ensures that for adding source with kind="file", you need to be outside of the API to ensure you're not opening files inside it.


🛠️ Changes Made

  • Changed the add_source() function to raise an error if kind=file and running inside the api

✅ Checklist

  • I updated the documentation (if applicable)
  • I have tested the changes in this PR
  • If I introduced a deprecation:

🧪 Testing

Manual test that helper function is correct, and that the flow that reach add_source do not enter kind=file when running from the API


🔗 References


🚨 Breaking Changes?

  • Yes (explain below)
  • No

🔍️ Additional Notes

@elbamit elbamit marked this pull request as ready for review October 16, 2025 13:57
@elbamit elbamit requested a review from liranbg as a code owner October 16, 2025 13:57
@liranbg liranbg changed the title [Security] - Ensure files are not opened from the API during secret_sources handling [Security] Ensure files are not opened from the API during secret_sources handling Oct 16, 2025
…lready exists. Refactor add_source accordingly
@liranbg liranbg added the 1.11.0 label Oct 19, 2025
@liranbg liranbg merged commit 9c715e9 into mlrun:development Dec 4, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants