-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add content to assignment controller #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| if (existingAssignment._count.questions > 0) { | ||
| this.logger.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mend Code Security Check
New finding (1 of 2)
The Mend Code Security Check of your branch failed because of a Log Forging finding in this line.
| Severity | Vulnerability Type | CWE | File | Data Flows | Detected | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Log Forging | 1 | 2025-11-19 10:46pm | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
| if (!existingAssignment) { | |
| throw new NotFoundException(`Assignment with Id ${id} not found.`); | |
| } | |
| if (existingAssignment._count.questions > 0) { | |
| this.logger.warn( |
1 Data Flow/s detected
| addContentToAssignment( |
| return this.adminService.addContentToAssignment( |
mark/apps/api/src/api/admin/admin.service.ts
Line 2071 in eae87a3
| async addContentToAssignment( |
mark/apps/api/src/api/admin/admin.service.ts
Line 2076 in eae87a3
| const { assignment, config, gradingCriteria, questions } = |
mark/apps/api/src/api/admin/admin.service.ts
Line 2079 in eae87a3
| const result = await this.prisma.$transaction(async (tx) => { |
mark/apps/api/src/api/admin/admin.service.ts
Line 2095 in eae87a3
| `Assignment ${id} already has ${existingAssignment._count.questions} questions. Adding ${questions.length} more.`, |
mark/apps/api/src/api/admin/admin.service.ts
Line 2094 in eae87a3
| this.logger.warn( |
Secure Code Warrior Training Material
● Training
▪ Secure Code Warrior Log Forging Training
● Videos
▪ Secure Code Warrior Log Forging Video
● Further Reading
🏴 Suppress Finding
- ... as False Alarm
- ... as Acceptable Risk
| }); | ||
| createdQuestions.push(...fetchedQuestions); | ||
|
|
||
| this.logger.log( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mend Code Security Check
New finding (2 of 2)
The Mend Code Security Check of your branch failed because of a Log Forging finding in this line.
| Severity | Vulnerability Type | CWE | File | Data Flows | Detected | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Log Forging | 1 | 2025-11-19 10:46pm | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
| where: { assignmentId: id }, | |
| orderBy: { id: "asc" }, | |
| }); | |
| createdQuestions.push(...fetchedQuestions); | |
| this.logger.log( |
1 Data Flow/s detected
| addContentToAssignment( |
| return this.adminService.addContentToAssignment( |
mark/apps/api/src/api/admin/admin.service.ts
Line 2071 in eae87a3
| async addContentToAssignment( |
mark/apps/api/src/api/admin/admin.service.ts
Line 2076 in eae87a3
| const { assignment, config, gradingCriteria, questions } = |
mark/apps/api/src/api/admin/admin.service.ts
Line 2079 in eae87a3
| const result = await this.prisma.$transaction(async (tx) => { |
mark/apps/api/src/api/admin/admin.service.ts
Line 2142 in eae87a3
| `Successfully added ${questions.length} questions to assignment ${id}`, |
mark/apps/api/src/api/admin/admin.service.ts
Line 2141 in eae87a3
| this.logger.log( |
Secure Code Warrior Training Material
● Training
▪ Secure Code Warrior Log Forging Training
● Videos
▪ Secure Code Warrior Log Forging Video
● Further Reading
🏴 Suppress Finding
- ... as False Alarm
- ... as Acceptable Risk
PR Description
Overview:
Type of Issue:
feat): New functionality or feature added.bug): Issue or bug resolved.chore): Maintenance, refactoring, or non-functional changes.doc): Documentation improvements or additions.Change Type:
Test Coverage
Evidence:
Impact / Risk
Rollback
Reviewer Focus