Programming Question

Assignment due Monday, May 11, 2026 by 11:59pm

ICS 432 – Assignment 3

Part A: Conceptual Questions

Answer each question concisely (approx. 150-200 words each). Clarity and the use of specific, real-world examples are key to earning full marks.

  • CIA Triad in Practice
    • Define the Confidentiality, Integrity, and Availability components of the CIA triad. For each component, provide one distinct real-world example of a security breach and briefly explain how the principle was violated.
  • SQL Injection & XSS
    • Describe, step-by-step, how an attacker could exploit a SQL injection vulnerability in a web application’s login form to bypass authentication. Provide the parameterised query (using a Python DB-API placeholder style like %s) that would prevent this attack.
    • Explain a Stored (Persistent) XSS attack. Then, recommend one specific output-encoding defence (e.g., HTML escaping) and describe what it does to neutralise the threat.
  • Threat Modelling in Agile
    • Outline the four main steps of a streamlined threat modelling process suitable for Agile development. Apply these steps to a simple “to-do list” web application by identifying at least two potential threats.
  • Secure Design Patterns
    • Compare and contrast the Secure Defaults and Principle of Least Privilege (PoLP) design patterns. Provide one concrete example of how each can be implemented within a micro-services architecture (e.g., database credentials, API permissions).
  • Insecure Deserialisation
    • Describe how an attacker can exploit insecure deserialisation in a Python application (e.g., using the pickle module) to achieve remote code execution (RCE). Recommend and briefly explain two primary mitigation strategies.

Part B: Hands-On Exercises

1. Code Review & Remediation

You are given the following Python Flask snippet:

##

from flask import Flask, request

import pickle

import base64

app = Flask(__name__)

@app.route(‘/unpack’, methods=[‘POST’])

def unpack_data():

data = request.form['data']decoded_data = base64.b64decode(data)# Deserialise the data to reconstruct the objectreconstituted_object = pickle.loads(decoded_data)return "Object deserialised!", 200

if __name__ == ‘__main__’:

(debug=True)

##

(a) Identify: Identify the critical security flaw(s) in this code. State the CWE (Common Weakness Enumeration) identifier if known.

(b) Exploit Description: Describe, with a code example, how an attacker could craft a malicious payload to exploit this flaw.

(c) Fix the Code: Rewrite the /unpack endpoint to securely handle the data. Your solution must use JSON for serialisation and include strict schema validation using a library like Pydantic or Marshmallow. Include comments in your code.

(d) Explanation: Explain why your fix effectively prevents the original vulnerability.

2. Fuzz Testing Lab

A vulnerable Python function is designed to process user-provided strings but contains a flaw.

##

def vulnerable_parser(input_string):

"""A supposedly safe function that processes a string."""# This condition is intended to check for a specific, safe commandif input_string.startswith("SAFE:"):    command = input_string[5:]  # Get the part after "SAFE:"    # Intended to split the command, but has a flaw    parts = command.split('|')    if len(parts) == 2:        # Simulate a command execution (this is a vulnerability)        return f"Executing {parts[0]} with arg {parts[1]}"return "Invalid command

##

(a) Set up: Briefly outline the steps to configure a Python fuzzer (e.g., Atheris or pythonfuzz) to fuzz this function. What would be a good initial corpus of test inputs?

(b) Crash Analysis: Suppose the fuzzer reports a crash when the input string is “SAFE:” + “A” * 1000. Hypothesise the type of vulnerability that might be present (e.g., denial-of-service via excessive resource consumption, command injection) and explain why the crash occurs.

(c) Mitigation: Rewrite the vulnerable_parser function to safely handle arbitrary input. Your fix should address the hypothesised vulnerability and include input validation and safe processing logic.

3. CI/CD Security Integration

You are tasked with integrating security checks into an existing GitLab CI/CD pipeline for a Python project.

(a) Static Analysis: Name two open-source Static Application Security Testing (SAST) tools suitable for Python (e.g., Bandit, Semgrep). Justify your choice for one. Then, provide a YAML snippet to integrate one of these tools into a .gitlab-ci.yml file, defining a job named sast.

(b) Dynamic Scanning: Propose how to integrate the fuzzing test from Exercise 2 into the pipeline. Sketch the CI stage definition (YAML snippet) for a job named fuzz-test. Assume the fuzzer is set to run for a fixed duration (e.g., 5 minutes).

(c) Policy Enforcement: Describe how you would configure the sast and fuzz-test jobs to fail the pipeline if any high-severity security issues or crashes are detected, respectively.

Part C: Threat Model & Design Pattern Proposal

Working in teams of 2-3, choose a simple web service (e.g., a file-sharing app, a secure note-taking API, or a user profile manager). Deliver a 2-page maximum report that includes:

  1. Threat Model Diagram (5 marks): A data flow diagram (DFD) of your chosen system with clearly labeled components, data flows, and at least five distinct trust boundaries.
  1. Threat Enumeration (5 marks): A table listing four distinct threats, each mapped to its corresponding STRIDE category.
  1. Mitigation via Design Patterns (5 marks): For each threat, propose one specific mitigation using one of the following secure-by-design patterns:
  • Secure Defaults
  • Principle of Least Privilege
  • Secure Contract (e.g., input validation schemas)
  1. CI/CD Security Gate (5 marks): Define one automated check (static or dynamic) that could be integrated into a CI/CD pipeline to enforce one of your proposed mitigations at build time. Justify your choice.

Report Guidelines:

  • The report must be concise and well-structured.
  • Cite all external sources (APA or IEEE style).
  • Include both team member names and student IDs on the cover page.

Submission Guidelines

Submit your assignment as 2 submissions.

  • The primary submission is a PDF document for the report named ICS432_Assignment3_Group_[YourGroupNumber].pdf
  • The secondary submission is a ZIP file named ICS432_Assignment3_Group_[YourGroupNumber].zip. The ZIP file must contain separate, well-commented Python source code files (.py) for the fixed code in Part B.1 and the fuzzing lab in Part B.2.

Calculate the price of your order

Select your paper details and see how much our professional writing services will cost.

We`ll send you the first draft for approval by at
Price: $36
  • Freebies
  • Format
  • Formatting (MLA, APA, Chicago, custom, etc.)
  • Title page & bibliography
  • 24/7 customer support
  • Amendments to your paper when they are needed
  • Chat with your writer
  • 275 word/double-spaced page
  • 12 point Arial/Times New Roman
  • Double, single, and custom spacing
  • We care about originality

    Our custom human-written papers from top essay writers are always free from plagiarism.

  • We protect your privacy

    Your data and payment info stay secured every time you get our help from an essay writer.

  • You control your money

    Your money is safe with us. If your plans change, you can get it sent back to your card.

How it works

  1. 1
    You give us the details
    Complete a brief order form to tell us what kind of paper you need.
  2. 2
    We find you a top writer
    One of the best experts in your discipline starts working on your essay.
  3. 3
    You get the paper done
    Enjoy writing that meets your demands and high academic standards!

Samples from our advanced writers

Check out some essay pieces from our best essay writers before your place an order. They will help you better understand what our service can do for you.

  • Essay (any type)
    Direct Social Work Practice and Helping Process
    Undergrad. (yrs 3-4)
    Social Work and Human Services
    APA

Get your own paper from top experts

Order now

Perks of our essay writing service

We offer more than just hand-crafted papers customized for you. Here are more of our greatest perks.

  • Swift delivery
    Our writing service can deliver your short and urgent papers in just 4 hours!
  • Professional touch
    We find you a pro writer who knows all the ins and outs of your subject.
  • Easy order placing/tracking
    Create a new order and check on its progress at any time in your dashboard.
  • Help with any kind of paper
    Need a PhD thesis, research project, or a two-page essay? For you, we can do it all.
  • Experts in 80+ subjects
    Our pro writers can help you with anything, from nursing to business studies.
  • Calculations and code
    We also do math, write code, and solve problems in 30+ STEM disciplines.

Frequently asked questions

Get instant answers to the questions that students ask most often.

See full FAQ
  • How do you find the best essay writer for me?

    Our professional writing service focuses on giving you the right specialist so the one assigned will have the knowledge about the right topic. However, if you’ve used our essay service before, you can ask us to assign you the expert writer who used to complete papers for you in the past. We can easily do so if the specialist in question is available at the moment.

    If you’re ordering from our essay writing service for the first time, we will assign you a suitable expert ourselves and ensure that your academic essay writer is a pro. Moreover, let us know how complex your assignment is so that we can find the best match for your order.

    We’ve hired the best writers in 80+ academic subjects to complete any paper you need. As soon as we hear, “Write my essays,” our support team assigns you the writer who understands your needs and subject.

    In case you need to make sure we’ve picked a great specialist to deal with your paper, you can chat with the expert writers directly. We do our best to make sure you’re happy with the writer we’ve selected for you.

  • How can you prove that your paper writing service is not a scam?

    We have been selling original essays for more than 15 years. To prove that we are a trustworthy custom essay writing company, we provide quick delivery and a money-back guarantee. If we can’t complete your paper for any reason, we’ll send your money back to the credit card. We want to deliver the finest services, so you can decide if the paper is good enough; from our side, we’ll edit it according to your primary requirements to make the writing perfect. Our online paper writing service is about both giving you the materials you need when you need them and ensuring that your private data is safe. Check out our guarantees to see how we control the quality of your assignment and protect you as a customer.

See full FAQ

Take your studies to the next level with our experienced specialists