Code-Projects Train Ticket Reservation System Stack-Based Buffer Overflow Vulnerability

Vulnerability

A stack-based buffer overflow vulnerability has been identified in the Train Ticket Reservation System version 1.0. The issue arises in the Ticket Reservation component, specifically within the Reservation function. The vulnerability is caused by the manipulation of the Name argument, which is stored in a character array of 50 bytes. The unsafe gets() function is used to read the input, allowing for local exploitation of the vulnerability.

Impact

Exploitation of this vulnerability leads to a stack-based buffer overflow, which can commonly result in arbitrary code execution or causing a program to crash.

Reproduction

To reproduce this vulnerability, run the Train Ticket Reservation System and navigate to the reservation function. When prompted to enter a name, input a string that exceeds 50 characters. This will overflow the buffer and cause a stack overflow, which can be observed by the resulting exception access violation.

Added: Jun 9, 2025, 7:46 PM
Updated: Jun 9, 2025, 7:46 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
2.5
exploitability
4.6
remediation
0.0
relevance
0.0
threat
6.4
urgency
2.9
incentive
0.8

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.