mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Formats code comments as sentences in the tests.
Capitalizes the first word and adds the terminal period in the unit, integration and security tests. The AAA markers stay bare, the TODO bodies stay lowercase, and no assertion, payload, expected status code or test signature changes.
This commit is contained in:
1 parent
727aa33318
commit
057f557791
540 files changed
+3888
-3888
No files matched your search
+2
-2
@@ -105,8 +105,8 @@ public class AddRoleEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Roles--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Roles--")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task AddRole_WithInjectionInRoleName_ShouldRemainSecure(string maliciousRoleName)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -87,8 +87,8 @@ public class DeleteRoleEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Roles--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Roles--")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task DeleteRole_WithInjectionInRoleId_ShouldRemainSecure(string maliciousRoleId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -105,8 +105,8 @@ public class UpdateRoleEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Roles--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Roles--")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task UpdateRole_WithInjectionInRoleName_ShouldRemainSecure(string maliciousRoleName)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -103,8 +103,8 @@ public class UpdateUserRoleAndPermissionsEndpointTests : IClassFixture<LuminaWeb
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Roles--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Roles--")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task UpdateUserRoleAndPermissions_WithInjectionInRoleId_ShouldRemainSecure(string maliciousRoleId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -91,10 +91,10 @@ public class AddFavoriteEndpointTests : IClassFixture<LuminaWebFactory>, IDispos
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Favorites--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Favorites--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task AddFavorite_WithInjectionPayloadInMediaKind_ShouldRejectItAndNotCallTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -118,10 +118,10 @@ public class AddFavoriteEndpointTests : IClassFixture<LuminaWebFactory>, IDispos
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Favorites--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Favorites--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task AddFavorite_WithInjectionPayloadInMediaItemId_ShouldRejectItAndNotCallTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -54,10 +54,10 @@ public class GetFavoriteStatusEndpointTests : IClassFixture<LuminaWebFactory>, I
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Favorites--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Favorites--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task GetFavoriteStatus_WithInjectionPayloadInMediaKind_ShouldRejectItAndNotCallTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -83,10 +83,10 @@ public class GetFavoriteStatusEndpointTests : IClassFixture<LuminaWebFactory>, I
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Favorites--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Favorites--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task GetFavoriteStatus_WithInjectionPayloadInMediaItemIds_ShouldRejectItAndNotCallTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -56,10 +56,10 @@ public class GetFavoritesEndpointTests : IClassFixture<LuminaWebFactory>, IDispo
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Favorites--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Favorites--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task GetFavorites_WithInjectionPayloadInMediaKind_ShouldRejectItAndNotCallTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -85,10 +85,10 @@ public class GetFavoritesEndpointTests : IClassFixture<LuminaWebFactory>, IDispo
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("currentPage", "' OR '1'='1")] // basic SQL injection in the page number
|
||||
[InlineData("currentPage", "1;DROP TABLE Favorites")] // destructive injection in the page number
|
||||
[InlineData("perPage", "' OR '1'='1")] // basic SQL injection in the page size
|
||||
[InlineData("perPage", "../../admin")] // path traversal in the page size
|
||||
[InlineData("currentPage", "' OR '1'='1")] // Basic SQL injection in the page number.
|
||||
[InlineData("currentPage", "1;DROP TABLE Favorites")] // Destructive injection in the page number.
|
||||
[InlineData("perPage", "' OR '1'='1")] // Basic SQL injection in the page size.
|
||||
[InlineData("perPage", "../../admin")] // Path traversal in the page size.
|
||||
public async Task GetFavorites_WithInjectionPayloadInPagination_ShouldRejectItAndNotCallTheApi(string parameterName, string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+9
-9
@@ -86,11 +86,11 @@ public class RemoveFavoriteEndpointTests : IClassFixture<LuminaWebFactory>, IDis
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Favorites--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("MusicTrack/../../admin")] // path traversal through a valid media kind prefix
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Favorites--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
[InlineData("MusicTrack/../../admin")] // Path traversal through a valid media kind prefix.
|
||||
public async Task RemoveFavorite_WithInjectionPayloadInMediaKind_ShouldSanitizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -118,10 +118,10 @@ public class RemoveFavoriteEndpointTests : IClassFixture<LuminaWebFactory>, IDis
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Favorites--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Favorites--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task RemoveFavorite_WithInjectionPayloadInMediaItemId_ShouldSanitizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ public class GetDirectoriesEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Directories--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Directories--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task GetDirectories_WhenCalledWithInjectionInPath_ShouldRemainSecure(string maliciousPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ public class GetFilesEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Files--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Files--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task GetFiles_WhenCalledWithInjectionInPath_ShouldRemainSecure(string maliciousPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -45,8 +45,8 @@ public class CheckPathExistsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Paths--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Paths--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task CheckPathExists_WhenCalledWithInjectionInPath_ShouldRemainSecure(string maliciousPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ public class GetPathParentEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Paths--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Paths--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task GetPathParent_WhenCalledWithInjectionInPath_ShouldRemainSecure(string maliciousPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -45,15 +45,15 @@ public class GetPathRootEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Paths--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Paths--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task GetPathRoot_WhenCalledWithInjectionInPath_ShouldRemainSecure(string maliciousPath)
|
||||
{
|
||||
// Arrange
|
||||
_apiFactory.ApiClientStub.Reset();
|
||||
string expectedEndpoint = $"path/get-path-root?path={Uri.EscapeDataString(maliciousPath)}";
|
||||
// a deterministic path keeps the content assertions independent of randomized fixture data, which could
|
||||
// otherwise contain one of the forbidden substrings by coincidence
|
||||
// A deterministic path keeps the content assertions independent of randomized fixture data, which could
|
||||
// otherwise contain one of the forbidden substrings by coincidence.
|
||||
_apiFactory.ApiClientStub.RegisterGetResponse(expectedEndpoint, _pathSegmentDtoFixture.Create(path: "/documents/reports/final-report.pdf"));
|
||||
AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory);
|
||||
HttpRequestMessage getRequest = new(HttpMethod.Get, $"/path/api-get-path-root?path={Uri.EscapeDataString(maliciousPath)}");
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ public class SplitPathEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Paths--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Paths--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task SplitPath_WhenCalledWithInjectionInPath_ShouldRemainSecure(string maliciousPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -45,8 +45,8 @@ public class ValidatePathEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Paths--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Paths--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task ValidatePath_WhenCalledWithInjectionInPath_ShouldRemainSecure(string maliciousPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -46,9 +46,9 @@ public class GetThumbnailEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Thumbnails--")] // destructive SQL injection
|
||||
[InlineData("..\\..\\appsettings.json")] // path traversal
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Thumbnails--")] // Destructive SQL injection.
|
||||
[InlineData("..\\..\\appsettings.json")] // Path traversal.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task GetThumbnail_WhenCalledWithInjectionInPath_ShouldRemainSecure(string maliciousPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -31,8 +31,8 @@ public class DeleteMusicAlbumEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Albums; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Albums; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task DeleteMusicAlbum_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverDeleteAnotherAlbum(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -49,8 +49,8 @@ public class GetArtistAlbumsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Albums; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Albums; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task GetArtistAlbums_WithSQLInjectionInArtistId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ public class GetMusicAlbumEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Albums; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Albums; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task GetMusicAlbum_WithSQLInjectionInRouteId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -32,8 +32,8 @@ public class RestoreMusicAlbumEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Albums; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Albums; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task RestoreMusicAlbum_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverRestoreAnotherAlbum(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -58,8 +58,8 @@ public class RestoreMusicAlbumEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Albums; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Albums; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task RestoreMusicAlbum_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -38,8 +38,8 @@ public class SaveMusicAlbumEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Albums; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Albums; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveMusicAlbum_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverCallAnotherAlbum(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -67,8 +67,8 @@ public class SaveMusicAlbumEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Albums; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Albums; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveMusicAlbum_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -93,8 +93,8 @@ public class SaveMusicAlbumEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Albums; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Albums; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveMusicAlbum_WithSQLInjectionInPostedTitle_ShouldNotLeakOrExecuteIt(string maliciousTitle)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -33,8 +33,8 @@ public class UpdateAlbumCoverEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Albums; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Albums; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task UpdateAlbumCover_WithSQLInjectionInRouteId_ShouldNeverReachAnAlbumOrLeakData(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -57,8 +57,8 @@ public class UpdateAlbumCoverEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE MusicArtwork; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE MusicArtwork; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task UpdateAlbumCover_WithSQLInjectionInLibraryQueryId_ShouldNormalizeItAndNotLeakData(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -31,8 +31,8 @@ public class DeleteMusicArtistEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Artists; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task DeleteMusicArtist_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverDeleteAnotherArtist(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ public class GetMusicArtistEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Artists; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task GetMusicArtist_WithSQLInjectionInRouteId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -49,8 +49,8 @@ public class GetMusicArtistsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Artists--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task GetMusicArtists_WhenCalledWithInjectionInSearchTerm_ShouldRemainSecure(string maliciousSearchTerm)
|
||||
{
|
||||
// Arrange
|
||||
@@ -80,8 +80,8 @@ public class GetMusicArtistsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Artists--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task GetMusicArtists_WhenCalledWithInjectionInFilterAlphaKey_ShouldRemainSecure(string maliciousAlphaKey)
|
||||
{
|
||||
// Arrange
|
||||
@@ -106,8 +106,8 @@ public class GetMusicArtistsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Artists--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task GetMusicArtists_WhenCalledWithInjectionInSortBy_ShouldRemainSecure(string maliciousSortBy)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -32,8 +32,8 @@ public class RestoreMusicArtistEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Artists; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task RestoreMusicArtist_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverRestoreAnotherArtist(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -58,8 +58,8 @@ public class RestoreMusicArtistEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Artists; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task RestoreMusicArtist_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -37,8 +37,8 @@ public class SaveMusicArtistEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Artists; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveMusicArtist_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverCallAnotherArtist(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -66,8 +66,8 @@ public class SaveMusicArtistEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Artists; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveMusicArtist_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -91,8 +91,8 @@ public class SaveMusicArtistEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Artists; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveMusicArtist_WithSQLInjectionInPostedName_ShouldNotLeakOrExecuteIt(string maliciousName)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -33,8 +33,8 @@ public class UpdateArtistCoverEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Artists; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Artists; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task UpdateArtistCover_WithSQLInjectionInRouteId_ShouldNeverReachAnArtistOrLeakData(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -57,8 +57,8 @@ public class UpdateArtistCoverEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE MusicArtwork; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE MusicArtwork; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task UpdateArtistCover_WithSQLInjectionInLibraryQueryId_ShouldNormalizeItAndNotLeakData(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ public class DeletedMusicItemsViewEndpointTests : IClassFixture<LuminaWebFactory
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Libraries; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Libraries; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task DeletedMusicItemsView_WithSQLInjectionInLibraryQueryId_ShouldNeverForwardTheMaliciousIdToTheApi(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -31,8 +31,8 @@ public class DeleteMusicTrackEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task DeleteMusicTrack_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverDeleteAnotherTrack(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -57,8 +57,8 @@ public class DeleteMusicTrackEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task DeleteMusicTrack_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ public class EditMusicTrackViewEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task EditMusicTrack_WithSQLInjectionInRouteId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -49,8 +49,8 @@ public class GetAlbumTracksEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task GetAlbumTracks_WithSQLInjectionInArtistId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -77,8 +77,8 @@ public class GetAlbumTracksEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task GetAlbumTracks_WithSQLInjectionInAlbumId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ public class GetMusicTrackEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task GetMusicTrack_WithSQLInjectionInRouteId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -32,8 +32,8 @@ public class RestoreMusicTrackEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task RestoreMusicTrack_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverRestoreAnotherTrack(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -58,8 +58,8 @@ public class RestoreMusicTrackEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task RestoreMusicTrack_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -43,8 +43,8 @@ public class SaveMusicTrackEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveMusicTrack_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverCallAnotherTrack(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -72,8 +72,8 @@ public class SaveMusicTrackEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveMusicTrack_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -99,8 +99,8 @@ public class SaveMusicTrackEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveMusicTrack_WithSQLInjectionInPostedTitle_ShouldNotLeakOrExecuteIt(string maliciousTitle)
|
||||
{
|
||||
// Arrange
|
||||
@@ -130,8 +130,8 @@ public class SaveMusicTrackEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("C:\\Windows\\System32\\drivers\\etc\\hosts")] // Windows sensitive file
|
||||
[InlineData("/etc/passwd")] // Unix sensitive file
|
||||
[InlineData("C:\\Windows\\System32\\drivers\\etc\\hosts")] // Windows sensitive file.
|
||||
[InlineData("/etc/passwd")] // Unix sensitive file.
|
||||
public async Task SaveMusicTrack_WhenPostedBodyAttemptsToSetTheFilePath_ShouldNotForwardAFilePathToTheApi(string attemptedPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -63,8 +63,8 @@ public class ShuffleTracksEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task ShuffleTracks_WithInjectionInLibraryId_ShouldRejectTheRequestWithoutCallingTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -81,8 +81,8 @@ public class ShuffleTracksEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task ShuffleTracks_WithInjectionInCount_ShouldRejectTheRequestWithoutCallingTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -99,8 +99,8 @@ public class ShuffleTracksEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task ShuffleTracks_WithInjectionInExcludedTrackIds_ShouldRejectTheRequestWithoutCallingTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -55,9 +55,9 @@ public class StreamMusicTrackEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("artistId")] // injection in the artist Id
|
||||
[InlineData("albumId")] // injection in the album Id
|
||||
[InlineData("trackId")] // injection in the track Id
|
||||
[InlineData("artistId")] // Injection in the artist Id.
|
||||
[InlineData("albumId")] // Injection in the album Id.
|
||||
[InlineData("trackId")] // Injection in the track Id.
|
||||
public async Task StreamMusicTrack_WithAnInjectionPayloadInATrackRouteId_ShouldNormalizeTheIdWithoutLeakingData(string routeValue)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -54,9 +54,9 @@ public class StreamMusicTrackSegmentEndpointTests : IClassFixture<LuminaWebFacto
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // destructive injection in the delivery handle
|
||||
[InlineData("' OR '1'='1")] // boolean based injection in the delivery handle
|
||||
[InlineData("../../etc/passwd")] // path traversal in the delivery handle
|
||||
[InlineData("'; DROP TABLE Tracks; --")] // Destructive injection in the delivery handle.
|
||||
[InlineData("' OR '1'='1")] // Boolean based injection in the delivery handle.
|
||||
[InlineData("../../etc/passwd")] // Path traversal in the delivery handle.
|
||||
public async Task StreamMusicTrackSegment_WithAnInjectionPayloadInDeliveryId_ShouldRejectTheRequestWithoutCallingTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -82,9 +82,9 @@ public class StreamMusicTrackSegmentEndpointTests : IClassFixture<LuminaWebFacto
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("artistId")] // injection in the artist Id
|
||||
[InlineData("albumId")] // injection in the album Id
|
||||
[InlineData("trackId")] // injection in the track Id
|
||||
[InlineData("artistId")] // Injection in the artist Id.
|
||||
[InlineData("albumId")] // Injection in the album Id.
|
||||
[InlineData("trackId")] // Injection in the track Id.
|
||||
public async Task StreamMusicTrackSegment_WithAnInjectionPayloadInATrackRouteId_ShouldNormalizeTheIdWithoutLeakingData(string routeValue)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -43,8 +43,8 @@ public class GetBookReadersEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Libraries--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Libraries--")] // Destructive injection.
|
||||
public async Task GetBookReaders_WhenCalledWithInjectionInLibraryId_ShouldRemainSecure(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -66,8 +66,8 @@ public class ScanLibraryEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Libraries--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Libraries--")] // Destructive injection.
|
||||
public async Task ScanLibrary_WithInjectionInId_ShouldNotLeakOrError(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -96,8 +96,8 @@ public class DeleteConsumptionItemHistoryEndpointTests : IClassFixture<LuminaWeb
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Movie%2F..%2Fadmin%3Fx%3D1")] // path traversal attempt in the media kind
|
||||
[InlineData("NotAMediaKind")] // undefined enum member
|
||||
[InlineData("Movie%2F..%2Fadmin%3Fx%3D1")] // Path traversal attempt in the media kind.
|
||||
[InlineData("NotAMediaKind")] // Undefined enum member.
|
||||
public async Task DeleteConsumptionItemHistory_WithCraftedMediaKind_ShouldRejectRequestAndNotCallApi(string craftedMediaKind)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -58,8 +58,8 @@ public class GetConsumptionStatisticsEndpointTests : IClassFixture<LuminaWebFact
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Movie%2F..%2Fadmin%3Fx%3D1")] // path traversal attempt in the media kind
|
||||
[InlineData("NotAMediaKind")] // undefined enum member
|
||||
[InlineData("Movie%2F..%2Fadmin%3Fx%3D1")] // Path traversal attempt in the media kind.
|
||||
[InlineData("NotAMediaKind")] // Undefined enum member.
|
||||
public async Task GetConsumptionStatistics_WithCraftedMediaKind_ShouldRejectRequestAndNotCallApi(string craftedMediaKind)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -28,8 +28,8 @@ public class DeleteBookEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Books; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Books; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task DeleteBook_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverDeleteAnotherBook(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -54,8 +54,8 @@ public class DeleteBookEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Books; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Books; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task DeleteBook_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -48,8 +48,8 @@ public class GetBookDetailsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Books; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Books; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task GetBookDetails_WithSQLInjectionInBookId_ShouldNormalizeTheIdWithoutLeakingData(string maliciousBookId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -47,8 +47,8 @@ public class GetLibraryItemsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Books--")] // destructive SQL injection
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Books--")] // Destructive SQL injection.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
public async Task GetLibraryItems_WhenCalledWithInjectionInSearchTerm_ShouldRemainSecure(string maliciousSearchTerm)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -49,8 +49,8 @@ public class GetReadingAvailabilityEndpointTests : IClassFixture<LuminaWebFactor
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Books--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Books--")] // Destructive injection.
|
||||
public async Task GetReadingAvailability_WhenCalledWithInjectionInBookId_ShouldRemainSecure(string maliciousBookId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -49,8 +49,8 @@ public class GetReadingManifestEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Books--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Books--")] // Destructive injection.
|
||||
public async Task GetReadingManifest_WhenCalledWithInjectionInBookId_ShouldRemainSecure(string maliciousBookId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -47,8 +47,8 @@ public class GetReadingResourceEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("../../etc/passwd")] // directory traversal
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("../../etc/passwd")] // Directory traversal.
|
||||
public async Task GetReadingResource_WhenCalledWithMaliciousResourceKey_ShouldRemainSecure(string maliciousResourceKey)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -49,8 +49,8 @@ public class GetReadingSectionEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Books--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Books--")] // Destructive injection.
|
||||
public async Task GetReadingSection_WhenCalledWithInjectionInLocationRef_ShouldRemainSecure(string maliciousLocationRef)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -28,8 +28,8 @@ public class RestoreBookEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Books; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Books; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task RestoreBook_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverRestoreAnotherBook(string maliciousId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -54,8 +54,8 @@ public class RestoreBookEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Books; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Books; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task RestoreBook_WithSQLInjectionInLibraryQueryId_ShouldNormalizeTheLibraryId(string maliciousLibraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -38,8 +38,8 @@ public class SaveBookEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Books; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Books; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveBook_WithSQLInjectionInRouteId_ShouldNormalizeTheIdAndNeverCallTheBodyBookEndpoint(string maliciousBookId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -69,8 +69,8 @@ public class SaveBookEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Books; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Books; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task SaveBook_WithSQLInjectionInPostedTitle_ShouldNotLeakOrExecuteIt(string maliciousTitle)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -31,8 +31,8 @@ public class UpdateBookCoverEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("'; DROP TABLE Books; --")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // boolean-based injection
|
||||
[InlineData("'; DROP TABLE Books; --")] // Destructive injection.
|
||||
[InlineData("' OR '1'='1")] // Boolean-based injection.
|
||||
public async Task UpdateBookCover_WithSQLInjectionInRouteId_ShouldNeverReachABookOrLeakData(string maliciousBookId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -124,10 +124,10 @@ public class CompleteConsumptionEndpointTests : IClassFixture<LuminaWebFactory>,
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("1;DROP TABLE")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("1;DROP TABLE")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task CompleteConsumption_WithInjectionPayloadInRecordId_ShouldUseTheEmptyGuidAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+9
-9
@@ -60,11 +60,11 @@ public class GetResumePointEndpointTests : IClassFixture<LuminaWebFactory>, IDis
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("1;DROP TABLE")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("MusicTrack/../../admin")] // path traversal through a valid media kind prefix
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("1;DROP TABLE")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
[InlineData("MusicTrack/../../admin")] // Path traversal through a valid media kind prefix.
|
||||
public async Task GetResumePoint_WithInjectionPayloadInMediaKind_ShouldSanitizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -91,10 +91,10 @@ public class GetResumePointEndpointTests : IClassFixture<LuminaWebFactory>, IDis
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("1;DROP TABLE")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("1;DROP TABLE")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task GetResumePoint_WithInjectionPayloadInMediaItemId_ShouldUseTheEmptyGuidAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -122,10 +122,10 @@ public class ReportConsumptionProgressEndpointTests : IClassFixture<LuminaWebFac
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("1;DROP TABLE")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("1;DROP TABLE")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task ReportConsumptionProgress_WithInjectionPayloadInRecordId_ShouldUseTheEmptyGuidAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+13
-13
@@ -121,11 +121,11 @@ public class StartConsumptionEndpointTests : IClassFixture<LuminaWebFactory>, ID
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("1;DROP TABLE")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("MusicTrack/../../admin")] // path traversal through a valid media kind prefix
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("1;DROP TABLE")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
[InlineData("MusicTrack/../../admin")] // Path traversal through a valid media kind prefix.
|
||||
public async Task StartConsumption_WithInjectionPayloadInMediaKind_ShouldSanitizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -151,10 +151,10 @@ public class StartConsumptionEndpointTests : IClassFixture<LuminaWebFactory>, ID
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("1;DROP TABLE")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("1;DROP TABLE")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task StartConsumption_WithInjectionPayloadInLibraryId_ShouldUseTheEmptyGuidAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -176,10 +176,10 @@ public class StartConsumptionEndpointTests : IClassFixture<LuminaWebFactory>, ID
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("1;DROP TABLE")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("1;DROP TABLE")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task StartConsumption_WithInjectionPayloadInMediaItemId_ShouldUseTheEmptyGuidAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -124,10 +124,10 @@ public class StopConsumptionEndpointTests : IClassFixture<LuminaWebFactory>, IDi
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("1;DROP TABLE")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // script injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("1;DROP TABLE")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Script injection.
|
||||
public async Task StopConsumption_WithInjectionPayloadInRecordId_ShouldUseTheEmptyGuidAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+7
-7
@@ -108,10 +108,10 @@ public class AddPlaylistEntriesEndpointTests : IClassFixture<LuminaWebFactory>,
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
public async Task AddPlaylistEntries_WithInjectionPayloadInPlaylistId_ShouldNormalizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -137,9 +137,9 @@ public class AddPlaylistEntriesEndpointTests : IClassFixture<LuminaWebFactory>,
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
public async Task AddPlaylistEntries_WithInjectionPayloadInTrackIds_ShouldRejectTheRequestWithoutCallingTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+7
-7
@@ -105,10 +105,10 @@ public class AddPlaylistEntryEndpointTests : IClassFixture<LuminaWebFactory>, ID
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
public async Task AddPlaylistEntry_WithInjectionPayloadInPlaylistId_ShouldNormalizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -134,9 +134,9 @@ public class AddPlaylistEntryEndpointTests : IClassFixture<LuminaWebFactory>, ID
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
public async Task AddPlaylistEntry_WithInjectionPayloadInTrackId_ShouldRejectTheRequestWithoutCallingTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+7
-7
@@ -105,10 +105,10 @@ public class AddPlaylistScopeEntriesEndpointTests : IClassFixture<LuminaWebFacto
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
public async Task AddPlaylistScopeEntries_WithInjectionPayloadInPlaylistId_ShouldNormalizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -134,9 +134,9 @@ public class AddPlaylistScopeEntriesEndpointTests : IClassFixture<LuminaWebFacto
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("libraryId")] // required scope identifier
|
||||
[InlineData("artistId")] // optional scope identifier
|
||||
[InlineData("albumId")] // optional scope identifier
|
||||
[InlineData("libraryId")] // Required scope identifier.
|
||||
[InlineData("artistId")] // Optional scope identifier.
|
||||
[InlineData("albumId")] // Optional scope identifier.
|
||||
public async Task AddPlaylistScopeEntries_WithInjectionPayloadInScopeIds_ShouldRejectTheRequestWithoutCallingTheApi(string propertyName)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -106,10 +106,10 @@ public class CreatePlaylistEndpointTests : IClassFixture<LuminaWebFactory>, IDis
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
public async Task CreatePlaylist_WithInjectionPayloadInName_ShouldNotFailOrLeakThePayload(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -134,8 +134,8 @@ public class CreatePlaylistEndpointTests : IClassFixture<LuminaWebFactory>, IDis
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
public async Task CreatePlaylist_WithInjectionPayloadInType_ShouldRejectTheRequestWithoutCallingTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -98,10 +98,10 @@ public class DeletePlaylistEndpointTests : IClassFixture<LuminaWebFactory>, IDis
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
public async Task DeletePlaylist_WithInjectionPayloadInPlaylistId_ShouldNormalizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+5
-5
@@ -97,11 +97,11 @@ public class GetPlaylistEndpointTests : IClassFixture<LuminaWebFactory>, IDispos
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("1;DROP TABLE")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("𝕡𝕝𝕒𝕪𝕝𝕚𝕤𝕥")] // unicode payload
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("1;DROP TABLE")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
[InlineData("𝕡𝕝𝕒𝕪𝕝𝕚𝕤𝕥")] // Unicode payload.
|
||||
public async Task GetPlaylist_WithInjectionPayloadInPlaylistId_ShouldNormalizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -87,10 +87,10 @@ public class GetPlaylistsEndpointTests : IClassFixture<LuminaWebFactory>, IDispo
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("other-user-id")] // a plain identifier of another user
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("other-user-id")] // A plain identifier of another user.
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
public async Task GetPlaylists_WithAnotherUserIdInTheQueryString_ShouldKeepTheUsersMeScope(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+5
-5
@@ -105,11 +105,11 @@ public class PlaylistItemViewEndpointTests : IClassFixture<LuminaWebFactory>, ID
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("1;DROP TABLE")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("𝕡𝕝𝕒𝕪𝕝𝕚𝕤𝕥")] // unicode payload
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("1;DROP TABLE")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
[InlineData("𝕡𝕝𝕒𝕪𝕝𝕚𝕤𝕥")] // Unicode payload.
|
||||
public async Task PlaylistItemView_WithInjectionPayloadInPlaylistId_ShouldNormalizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -105,10 +105,10 @@ public class MovePlaylistEntryEndpointTests : IClassFixture<LuminaWebFactory>, I
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
public async Task MovePlaylistEntry_WithInjectionPayloadInRouteIds_ShouldNormalizeThemAndNotForwardTheRawValues(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -139,8 +139,8 @@ public class MovePlaylistEntryEndpointTests : IClassFixture<LuminaWebFactory>, I
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
public async Task MovePlaylistEntry_WithInjectionPayloadInTargetPosition_ShouldRejectTheRequestWithoutCallingTheApi(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -98,10 +98,10 @@ public class RemovePlaylistEntryEndpointTests : IClassFixture<LuminaWebFactory>,
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
public async Task RemovePlaylistEntry_WithInjectionPayloadInRouteIds_ShouldNormalizeThemAndNotForwardTheRawValues(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -105,10 +105,10 @@ public class UpdatePlaylistEndpointTests : IClassFixture<LuminaWebFactory>, IDis
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
public async Task UpdatePlaylist_WithInjectionPayloadInPlaylistId_ShouldNormalizeItAndNotForwardTheRawValue(string payload)
|
||||
{
|
||||
// Arrange
|
||||
@@ -135,10 +135,10 @@ public class UpdatePlaylistEndpointTests : IClassFixture<LuminaWebFactory>, IDis
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Playlists--")] // destructive injection
|
||||
[InlineData("../../admin")] // path traversal
|
||||
[InlineData("<script>alert(1)</script>")] // markup injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Playlists--")] // Destructive injection.
|
||||
[InlineData("../../admin")] // Path traversal.
|
||||
[InlineData("<script>alert(1)</script>")] // Markup injection.
|
||||
public async Task UpdatePlaylist_WithInjectionPayloadInName_ShouldNotFailOrLeakThePayload(string payload)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -47,8 +47,8 @@ public class GetPluginSettingsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Plugins--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Plugins--")] // Destructive injection.
|
||||
public async Task GetPluginSettings_WithInjectionInPluginId_ShouldNotLeakOrError(string maliciousPluginId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -62,8 +62,8 @@ public class GetPluginSettingsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
string content = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// Assert
|
||||
// note: the {pluginId} route parameter is Guid-typed, so the malicious value fails model binding and never
|
||||
// reaches the handler; the Web application reports the binding failure as a 200 response carrying success=false
|
||||
// Note: the {pluginId} route parameter is Guid-typed, so the malicious value fails model binding and never
|
||||
// Reaches the handler; the Web application reports the binding failure as a 200 response carrying success=false.
|
||||
using JsonDocument json = JsonDocument.Parse(content);
|
||||
Assert.False(json.RootElement.GetProperty("success").GetBoolean());
|
||||
Assert.DoesNotContain("Exception", content, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
+4
-4
@@ -48,8 +48,8 @@ public class ThemeAssetsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("'; DROP TABLE Themes--")] // destructive injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("'; DROP TABLE Themes--")] // Destructive injection.
|
||||
public async Task ThemeAssets_WithInjectionInThemeId_ShouldNotLeakOrError(string maliciousThemeId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -71,8 +71,8 @@ public class ThemeAssetsEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("..\\..\\appsettings.json")] // path traversal
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("..\\..\\appsettings.json")] // Path traversal.
|
||||
public async Task ThemeAssets_WithInjectionInPath_ShouldNotLeakOrError(string maliciousPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+5
-5
@@ -82,11 +82,11 @@ public class ChangePasswordEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("admin'--")] // comment injection
|
||||
[InlineData("' UNION SELECT * FROM Users--")] // union injection
|
||||
[InlineData("'; DROP TABLE Users--")] // destructive injection
|
||||
[InlineData("{{7*7}}")] // template injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("admin'--")] // Comment injection.
|
||||
[InlineData("' UNION SELECT * FROM Users--")] // Union injection.
|
||||
[InlineData("'; DROP TABLE Users--")] // Destructive injection.
|
||||
[InlineData("{{7*7}}")] // Template injection.
|
||||
public async Task ChangePassword_WithInjectionAttemptInNewPassword_ShouldRemainSecure(string maliciousNewPassword)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -35,11 +35,11 @@ public class LoginEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("admin'--")] // comment injection
|
||||
[InlineData("' UNION SELECT * FROM Users--")] // union injection
|
||||
[InlineData("'; DROP TABLE Users--")] // destructive injection
|
||||
[InlineData("{{7*7}}")] // template injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("admin'--")] // Comment injection.
|
||||
[InlineData("' UNION SELECT * FROM Users--")] // Union injection.
|
||||
[InlineData("'; DROP TABLE Users--")] // Destructive injection.
|
||||
[InlineData("{{7*7}}")] // Template injection.
|
||||
public async Task Login_WithInjectionAttemptInUsername_ShouldRemainSecure(string maliciousUsername)
|
||||
{
|
||||
// Arrange
|
||||
@@ -81,7 +81,7 @@ public class LoginEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
Assert.DoesNotContain("TestPass123!", content);
|
||||
Assert.DoesNotContain("hash", content, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.DoesNotContain("salt", content, StringComparison.OrdinalIgnoreCase);
|
||||
// the JWT token returned by the API must not be exposed in plaintext; it is stored encrypted in the Token cookie
|
||||
// The JWT token returned by the API must not be exposed in plaintext; it is stored encrypted in the Token cookie.
|
||||
Assert.DoesNotContain("test_jwt_token", content);
|
||||
string allSetCookies = string.Join("; ", response.Headers.GetValues("Set-Cookie"));
|
||||
Assert.Contains("Token=", allSetCookies);
|
||||
|
||||
+5
-5
@@ -35,11 +35,11 @@ public class RecoverPasswordEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("admin'--")] // comment injection
|
||||
[InlineData("' UNION SELECT * FROM Users--")] // union injection
|
||||
[InlineData("'; DROP TABLE Users--")] // destructive injection
|
||||
[InlineData("{{7*7}}")] // template injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("admin'--")] // Comment injection.
|
||||
[InlineData("' UNION SELECT * FROM Users--")] // Union injection.
|
||||
[InlineData("'; DROP TABLE Users--")] // Destructive injection.
|
||||
[InlineData("{{7*7}}")] // Template injection.
|
||||
public async Task RecoverPassword_WithInjectionAttemptInUsername_ShouldRemainSecure(string maliciousUsername)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+5
-5
@@ -35,11 +35,11 @@ public class RegisterEndpointTests : IClassFixture<LuminaWebFactory>
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("' OR '1'='1")] // basic SQL injection
|
||||
[InlineData("admin'--")] // comment injection
|
||||
[InlineData("' UNION SELECT * FROM Users--")] // union injection
|
||||
[InlineData("'; DROP TABLE Users--")] // destructive injection
|
||||
[InlineData("{{7*7}}")] // template injection
|
||||
[InlineData("' OR '1'='1")] // Basic SQL injection.
|
||||
[InlineData("admin'--")] // Comment injection.
|
||||
[InlineData("' UNION SELECT * FROM Users--")] // Union injection.
|
||||
[InlineData("'; DROP TABLE Users--")] // Destructive injection.
|
||||
[InlineData("{{7*7}}")] // Template injection.
|
||||
public async Task Register_WithInjectionAttemptInUsername_ShouldRemainSecure(string maliciousUsername)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
Reference in new issue
Block a user