Skip to content

Commit

Permalink
Enhanced
Browse files Browse the repository at this point in the history
  • Loading branch information
ParisNeo committed Apr 4, 2024
1 parent c04929e commit 1e17df0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lollms_core
6 changes: 5 additions & 1 deletion tests/pentests/test_sanitize/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import re
import pytest
def sanitize_path_from_endpoint(path: str, error_text="A suspected LFI attack detected. The path sent to the server has suspicious elements in it!", exception_text="Invalid path!"):
if path.strip().startswith("/"):
raise HTTPException(status_code=400, detail=exception_text)
# Fix the case of "/" at the beginning on the path
if path is None:
return path
Expand All @@ -25,7 +27,9 @@ def test_sanitize_path_from_endpoint():
assert sanitize_path_from_endpoint(valid_path) == "example/path"

# Test a path with suspicious elements
suspicious_path = "/images//D:/POC/secret.txt"
suspicious_path = "/D:/POC/secret.txt"

#suspicious_path = "/images//D:/POC/secret.txt"
with pytest.raises(HTTPException):
sanitize_path_from_endpoint(suspicious_path)

Expand Down

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions web/dist/assets/index-d4c7f2b1.css

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions web/dist/assets/index-dbb96f42.css

This file was deleted.

4 changes: 2 additions & 2 deletions web/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI - Welcome</title>
<script type="module" crossorigin src="/assets/index-98910268.js"></script>
<link rel="stylesheet" href="/assets/index-dbb96f42.css">
<script type="module" crossorigin src="/assets/index-91ab3091.js"></script>
<link rel="stylesheet" href="/assets/index-d4c7f2b1.css">
</head>
<body>
<div id="app"></div>
Expand Down
1 change: 1 addition & 0 deletions web/src/views/DiscussionsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,7 @@ export default {
messageItem && (msgObj.message_type==this.msgTypes.MSG_TYPE_FULL ||
msgObj.message_type==this.msgTypes.MSG_TYPE_FULL_INVISIBLE_TO_AI)
) {
this.isGenerating = true;
messageItem.content = msgObj.content
messageItem.finished_generating_at = msgObj.finished_generating_at
}
Expand Down

0 comments on commit 1e17df0

Please sign in to comment.