UPSTREAM PR #1156: fix(server): sanitize LoRA paths and enable dynamic loading - #2
Open
loci-dev wants to merge 2 commits into
Open
UPSTREAM PR #1156: fix(server): sanitize LoRA paths and enable dynamic loading#2loci-dev wants to merge 2 commits into
loci-dev wants to merge 2 commits into
Conversation
- Implement `sanitize_lora_path` in `SDGenerationParams` to prevent directory traversal attacks via LoRA tags in prompts. - Restrict LoRA paths to be relative and strictly within the configured LoRA directory (no subdirectories allowed, optional? drawback: users cannot organize their LoRAs into subfolders.). - Update server example to pass `lora_model_dir` to `process_and_check`, enabling LoRA extraction from prompts. - Force `LORA_APPLY_AT_RUNTIME` in the server to allow applying LoRAs dynamically per request without reloading the model.
loci-dev
temporarily deployed
to
stable-diffusion-cpp-prod
December 31, 2025 22:38 — with
GitHub Actions
Inactive
- Remove the restriction that LoRA models must be in the root of the LoRA directory, allowing them to be organized in subfolders. - Refactor the directory containment check to use `std::mismatch` instead of `lexically_relative` to verify the path is inside the allowed root. - Remove redundant `lexically_normal()` call when resolving file extensions.
loci-dev
temporarily deployed
to
stable-diffusion-cpp-prod
January 1, 2026 18:43 — with
GitHub Actions
Inactive
|
Explore the complete analysis inside the Version Insights I've successfully generated a comprehensive summary report for your project. The report shows: Key Highlights:
Top Performer:
Overall Assessment: |
loci-dev
force-pushed
the
master
branch
7 times, most recently
from
January 11, 2026 09:09
3e2648e to
178a7d8
Compare
loci-dev
force-pushed
the
master
branch
6 times, most recently
from
January 19, 2026 16:11
1f909e5 to
027a37e
Compare
loci-dev
force-pushed
the
master
branch
6 times, most recently
from
January 28, 2026 14:15
e31dd7d to
cf91470
Compare
loci-dev
force-pushed
the
master
branch
3 times, most recently
from
February 1, 2026 14:12
0219cb4 to
17a1e1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirrored from leejet/stable-diffusion.cpp#1156
sanitize_lora_pathinSDGenerationParamsto prevent directory traversal attacks via LoRA tags in prompts.lora_model_dirtoprocess_and_check, enabling LoRA extraction from prompts.LORA_APPLY_AT_RUNTIMEin the server to allow applying LoRAs dynamically per request without reloading the model and avoiding weight accumulation.