Commit 5d5c220
security: Fix test project BouncyCastle vulnerabilities + payment credentials hardening
**Vulnerabilities Fixed** (3 MODERATE - Test Project):
- GHSA-8xfc-gm6g-vgpv (CVE-2024-29857): CPU exhaustion via crafted F2m parameters
- GHSA-v435-xc8x-wvr9 (CVE-2024-30171): Timing-based leakage in RSA handshakes
- GHSA-m44j-cfrm-g8qc (CVE-2024-30172): Ed25519 infinite loop via crafted signature
**Security Hardening** (CRIT-5):
- Removed hardcoded Stripe/PayPal mock credentials from EnhancedPaymentService
- Enforced environment variables: STRIPE_PUBLIC_KEY, STRIPE_SECRET_KEY, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET
- Added validation to reject mock/insecure values
- Fail-fast if payment credentials not configured (no fallback)
**Performance Fix** (PERF-1):
- Fixed N+1 query problem in CourseRepository.GetAllAsync()
- Added Include(c => c.Reviews) to prevent separate query for each course rating
- Estimated improvement: 90% query reduction for course listings with reviews
**Package Updates**:
- Microsoft.Extensions.Logging.Abstractions: 8.0.2 → 8.0.3 (test project)
- BouncyCastle.Cryptography: 2.2.1 → 2.4.0 (transitive, fixed by logging update)
**Files Modified**:
- tests/InsightLearn.Tests.csproj
- src/InsightLearn.Application/Services/EnhancedPaymentService.cs
- src/InsightLearn.Infrastructure/Repositories/CourseRepository.cs
**Verification**: dotnet list package --vulnerable returns CLEAN (ALL projects, 0 vulnerabilities)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent d068ce8 commit 5d5c220
3 files changed
Lines changed: 58 additions & 6 deletions
File tree
- src
- InsightLearn.Application/Services
- InsightLearn.Infrastructure/Repositories
- tests
Lines changed: 29 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
56 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
57 | 81 | | |
58 | 82 | | |
59 | 83 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
| |||
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| 54 | + | |
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| 59 | + | |
49 | 60 | | |
50 | 61 | | |
51 | 62 | | |
| 63 | + | |
| 64 | + | |
52 | 65 | | |
53 | 66 | | |
54 | 67 | | |
| 68 | + | |
55 | 69 | | |
56 | 70 | | |
| 71 | + | |
57 | 72 | | |
58 | 73 | | |
59 | 74 | | |
60 | 75 | | |
61 | 76 | | |
62 | 77 | | |
63 | 78 | | |
| 79 | + | |
| 80 | + | |
64 | 81 | | |
65 | 82 | | |
66 | 83 | | |
| 84 | + | |
67 | 85 | | |
| 86 | + | |
68 | 87 | | |
69 | 88 | | |
70 | 89 | | |
71 | 90 | | |
72 | 91 | | |
| 92 | + | |
| 93 | + | |
73 | 94 | | |
74 | 95 | | |
75 | 96 | | |
| 97 | + | |
76 | 98 | | |
77 | 99 | | |
| 100 | + | |
78 | 101 | | |
79 | 102 | | |
80 | 103 | | |
81 | 104 | | |
82 | 105 | | |
83 | 106 | | |
84 | 107 | | |
| 108 | + | |
| 109 | + | |
85 | 110 | | |
86 | 111 | | |
87 | 112 | | |
88 | 113 | | |
89 | 114 | | |
| 115 | + | |
90 | 116 | | |
91 | 117 | | |
| 118 | + | |
92 | 119 | | |
93 | 120 | | |
94 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | | - | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
0 commit comments