Repository navigation
Arthur Aipov yaml - #590
Closed
ArthurAipov wants to merge 6 commits into
Closed
ArthurAipov wants to merge 6 commits into
ArthurAipov wants to merge 6 commits into
Conversation
Добавил в reports/task4/ отчёт на английском в Markdown и PDF, результат Bandit B307 и два скриншота локальной проверки. Разобрал CWE-95, CVSS, последствия и необходимые права атакующего. Моя находка — eval() в /lab2, command_injection_lab/app.py:49. Для своих разборов выберите другие уязвимости. Markdown можно использовать при сборке общего отчёта.
Analyzed unsafe YAML deserialization vulnerability (Bandit B506) in PyGoat application with complete security assessment and code remediation. Vulnerability Details: - Type: Unsafe YAML Deserialization (CWE-502) - Bandit Rule: B506 (yaml_load) - Location: dockerized_labs/a9_uckv_lab/app.py:62 - CVSS: 9.8 (Critical) / 8.8 (High with authentication) - Impact: Remote Code Execution (RCE) Deliverables: ✓ Full vulnerability analysis with CWE-502 classification ✓ CVSS v3.1 assessment: 9.8 / CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H ✓ Impact analysis and privilege assessment ✓ Complete technical documentation Bonus (Code Remediation): ✓ Code fix: yaml.load() → yaml.safe_load() + validation ✓ Bandit verification: 1 Medium issue → 0 issues ✓ Proof-of-concept demonstration with live RCE examples ✓ Type validation and improved error handling ✓ Full verification documentation Files: - 7 markdown documentation files (1300+ lines) - 2 source code files (vulnerable + fixed versions) - 4 proof-of-concept and test files - 3 Bandit scan reports (JSON and text format) Total: 16 files + images directory
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.
Summary
Completed Lab 5 DevSecOps individual assignment: analyzed unsafe YAML deserialization vulnerability (Bandit B506, CWE-502) in PyGoat application with full security assessment, CVSS scoring, and code remediation (bonus).
Problem / Motivation
Lab 5 requires each student to select an individual vulnerability from SAST scan results and perform comprehensive security analysis. Selected B506 (yaml_load) to avoid duplication with existing reports (eval injection, path traversal). This vulnerability allows remote code execution through malicious YAML files.
Fixes # (not applicable - lab assignment)
Solution / Approach
Core Requirements:
dockerized_labs/a9_uckv_lab/app.py:62Bonus:
yaml.load(Loader=yaml.Loader)withyaml.safe_load()Files Changed
COMPLETION_CHECKLIST.mdLAB5_SOLUTION.mdreports/yaml_deserialization/report.mdreports/yaml_deserialization/BONUS_FIX_VERIFICATION.mdreports/yaml_deserialization/app_vulnerable.pyreports/yaml_deserialization/app_fixed.pyreports/yaml_deserialization/demo_vulnerability.pyreports/yaml_deserialization/test_*.yamlreports/yaml_deserialization/bandit-*.txtreports/yaml_deserialization/bandit-full.jsonType of Change
Impact
yaml.safe_load()that blocks malicious payloadsScreenshots (if applicable)
N/A - Security analysis and code remediation (no UI changes)
Verification
Run the demonstration:
cd reports/yaml_deserialization python3 demo_vulnerability.py