Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -438,18 +438,18 @@ if st.session_state.analysis_stage >= 2 and st.session_state.ensemble_result is
|
|
438 |
- No significant red flags were detected in the ensemble
|
439 |
""")
|
440 |
|
441 |
-
# Final
|
442 |
-
st.
|
443 |
-
vote_benign = results['vote_count'][0] # Votes for safe
|
444 |
-
vote_malicious = results['vote_count'][1] # Votes for malicious
|
445 |
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
st.error("
|
451 |
-
else:
|
452 |
-
st.
|
|
|
|
|
453 |
|
454 |
# Reset button
|
455 |
if st.button("Analyze Another Query"):
|
|
|
438 |
- No significant red flags were detected in the ensemble
|
439 |
""")
|
440 |
|
441 |
+
# Final verdict combining both approaches
|
442 |
+
st.subheader("Final Analysis")
|
|
|
|
|
443 |
|
444 |
+
is_malicious_regex, _ = st.session_state.regex_result
|
445 |
+
is_malicious_ensemble = results['ensemble'] == 1
|
446 |
+
|
447 |
+
if is_malicious_regex or is_malicious_ensemble:
|
448 |
+
st.error("⚠️ This query appears to contain SQL injection patterns. Review carefully before executing.")
|
449 |
+
else:
|
450 |
+
st.success("✅ This query appears safe based on both rule-based and ensemble detection.")
|
451 |
+
|
452 |
+
st.info("ℹ️ Remember: Always use parameterized queries and proper input validation in production systems.")
|
453 |
|
454 |
# Reset button
|
455 |
if st.button("Analyze Another Query"):
|