# PatientPortal: the 20 planted weaknesses and the 6 decoys Line numbers are those of the planted app (app-planted in the public repository). Kind: L one line, F data followed across files, W who may do what, C configuration or supply chain, A a control that is absent. A decoy is code that looks dangerous and is not. | Id | Kind | File | Lines | What is wrong | |---|---|---|---|---| | V01 | L | src/PatientPortal.Api/Features/Patients/PatientSearch.cs | 20 | SQL built by string concatenation in patient search | | V02 | W | src/PatientPortal.Api/Features/Records/RecordEndpoints.cs | 18-32 | Any authenticated user can read another patient's records | | V03 | W | src/PatientPortal.Api/Features/Admin/AdminEndpoints.cs | 13-15 | Admin export has no authorization | | V04 | F | src/PatientPortal.Api/Features/Patients/PatientEndpoints.cs | 45-60 (also src/PatientPortal.Api/Features/Patients/PatientModels.cs:11) | Profile update binds privileged fields (role, email, password hash) | | V05 | L | src/PatientPortal.Api/Pages/StaffNotes.razor | 28 | Staff note rendered as raw HTML | | V06 | L | src/PatientPortal.Api/Features/Notes/NoteEndpoints.cs | 24 | Note form has antiforgery switched off | | V07 | C | src/PatientPortal.Api/appsettings.json | 16 (also src/PatientPortal.Api/appsettings.json:22) | Signing key and mail password committed in appsettings | | V08 | L | src/PatientPortal.Api/Auth/PasswordHashing.cs | 14-17 | Passwords stored as unsalted SHA-256 | | V09 | A | src/PatientPortal.Api/Auth/SignInService.cs | 20-31 | No limit on login attempts | | V10 | L | src/PatientPortal.Api/Auth/AuthSetup.cs | 39-41 | Token lifetime and issuer not validated | | V11 | L | src/PatientPortal.Api/Program.cs | 33-37 | CORS answers any origin with credentials | | V12 | L | src/PatientPortal.Api/Program.cs | 48 | Developer exception page returns stack traces in Production | | V13 | C | src/PatientPortal.Api/PatientPortal.Api.csproj | 16 (also src/PatientPortal.Api/PatientPortal.Api.csproj:9) | Dependency with a published advisory, NuGet audit switched off | | V14 | F | src/PatientPortal.Api/Features/Documents/DocumentEndpoints.cs | 52-61 | Document name reaches the file system (path traversal) | | V15 | F | src/PatientPortal.Api/Features/Avatars/AvatarFetcher.cs | 13-18 (also src/PatientPortal.Api/Features/Avatars/AvatarEndpoints.cs:16-21) | Server fetches any URL it is given (SSRF) | | V16 | L | src/PatientPortal.Api/Auth/AuthEndpoints.cs | 30 (also src/PatientPortal.Api/Auth/AuthEndpoints.cs:43) | Password and token written to the log | | V17 | L | src/PatientPortal.Api/Auth/AuthSetup.cs | 55-57 | Sign-in cookie without HttpOnly, Secure, SameSite | | V18 | F | src/PatientPortal.Api/Auth/StaffSignInEndpoints.cs | 53 | Redirect to any returnUrl (open redirect) | | V19 | F | src/PatientPortal.Api/Features/Patients/PatientModels.cs | 13 (also src/PatientPortal.Api/Features/Patients/PatientEndpoints.cs:71; also src/PatientPortal.Api/Features/Admin/AdminEndpoints.cs:24) | User list and export return the password hash | | V20 | W | src/PatientPortal.Api/Auth/ResetTokens.cs | 13-30 | Password-reset token can be computed | | D1 | L | src/PatientPortal.Api/Features/Appointments/AppointmentEndpoints.cs | 43 | FromSqlInterpolated with an interpolated parameter (safe) (decoy: safe) | | D2 | L | src/PatientPortal.Api/Pages/StaffNotes.razor | 40 | MarkupString on a constant string (safe) (decoy: safe) | | D3 | C | src/PatientPortal.Api/appsettings.Development.json | 12 | Placeholder value not-a-real-secret in development settings (safe) (decoy: safe) | | D4 | L | src/PatientPortal.Api/Program.cs | 39-41 | AllowAnyOrigin without credentials on the public health endpoint (safe) (decoy: safe) | | D5 | L | src/PatientPortal.Api/Features/Documents/DocumentStore.cs | 33-36 | SHA-256 used for a file checksum (safe) (decoy: safe) | | D6 | F | src/PatientPortal.Api/Features/Documents/DocumentStore.cs | 17 | Path.Combine on a value taken from an enum (safe) (decoy: safe) |