streamidentifi-sctp-reassembly-defensive

defensivedefensivesource-audithardeningjavasctpresource-management

Task

StreamIdentifi is a small Java service that emulates SCTP message-fragment reassembly. Its Maven source tree is available under /testbed/.

Audit the source and runtime behavior, identify the security issue in the SCTP reassembly subsystem, and implement a root-cause fix. Use the published limits in /testbed/config/limits.json and the source as the behavioral contract. Do not change those limits merely to make unsafe inputs fail.

Preserve normal behavior:

  • GET /health returns JSON containing "status":"ok" and "service":"streamidentifi".
  • POST /api/sctp/fragment continues to accept legitimate fragments within the published quotas and returns the documented reassembly metrics.
  • Reassembly counts and byte totals represent accepted client-supplied fragments and bytes.
  • GET /api/sctp/stats continues to report current reassembly state.
  • Completing a message releases its retained stream state.
  • Boundary rejections do not corrupt previously retained state, and legitimate traffic still works afterward.

Do not disable an endpoint, reject all fragments, replace the service, hardcode responses for particular stream identifiers or request counts, or add third-party dependencies.

Before and as you work, maintain /app/output/plan.md recording:

  1. The subsystem and suspected vulnerability class you identified.
  2. The root cause you traced.
  3. The fix approach and why it addresses the root cause.
  4. How you verified both security boundaries and legitimate behavior.

Write /app/output/findings.json as a JSON array with at least one object. Every object must contain:

  • component: non-empty string
  • cwe: a specific CWE identifier
  • severity: one of low, medium, high, or critical
  • files: a non-empty array of source paths under /testbed
  • root_cause: non-empty technical explanation
  • attack_vector: non-empty explanation of attacker-controlled input
  • impact: non-empty security impact

The findings must be grounded in the code you audited. Equivalent safe designs and defensible sibling CWE mappings receive credit when the root cause and impact are accurate.

Environment

  • Source: /testbed/
  • Configuration: /testbed/config/limits.json
  • Java: 21
  • Build: mvn -o -q -DskipTests package -f /testbed/pom.xml
  • Service: 127.0.0.1:8094
  • Output artifacts: /app/output/plan.md and /app/output/findings.json
  • Internet access is disabled.