IITGN-CS431 / project-cns

1 stars 27 forks source link

Functionality bug (Group-7) able to create an account with an invalid name #318

Closed pranjal15195gaur closed 3 days ago

pranjal15195gaur commented 4 days ago

pranjal@pranjal:~ /project-cns/project-submissions/group-7$ gdb atm GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git Copyright (C) 2024 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: https://www.gnu.org/software/gdb/bugs/. Find the GDB manual and other documentation resources online at: http://www.gnu.org/software/gdb/documentation/.

For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from atm...

This GDB supports auto-downloading debuginfo from the following URLs: https://debuginfod.ubuntu.com Enable debuginfod for this session? (y or [n]) y Debuginfod has been enabled. To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit. Downloading separate debug info for /project-cns/project-submissions/group-7/atm (No debugging symbols found in atm)
(gdb) set args -a @@@@ -n 10.00 -s bank.auth (gdb) break isValidAccountName Breakpoint 1 at 0x8fcf (gdb) run Starting program: /project-cns/project-submissions/group-7/atm -a @@@@ -n 10.00 -s bank.auth [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, 0x000055555555cfcf in isValidAccountName(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&) () (gdb) disassemble isValidAccountName Dump of assembler code for function Z18isValidAccountNameRKNSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEE: 0x000055555555cfc7 <+0>: endbr64 0x000055555555cfcb <+4>: push %rbp 0x000055555555cfcc <+5>: mov %rsp,%rbp => 0x000055555555cfcf <+8>: push %rbx 0x000055555555cfd0 <+9>: sub $0x48,%rsp 0x000055555555cfd4 <+13>: mov %rdi,-0x48(%rbp) 0x000055555555cfd8 <+17>: mov %fs:0x28,%rax 0x000055555555cfe1 <+26>: mov %rax,-0x18(%rbp) 0x000055555555cfe5 <+30>: xor %eax,%eax 0x000055555555cfe7 <+32>: mov -0x48(%rbp),%rax 0x000055555555cfeb <+36>: mov %rax,%rdi 0x000055555555cfee <+39>: call 0x55555555c3a0 ZNKSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv@plt 0x000055555555cff3 <+44>: test %rax,%rax 0x000055555555cff6 <+47>: je 0x55555555d00a <Z18isValidAccountNameRKNSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+67> 0x000055555555cff8 <+49>: mov -0x48(%rbp),%rax 0x000055555555cffc <+53>: mov %rax,%rdi 0x000055555555cfff <+56>: call 0x55555555c3a0 ZNKSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv@plt 0x000055555555d004 <+61>: cmp $0x7a,%rax 0x000055555555d008 <+65>: jbe 0x55555555d011 <Z18isValidAccountNameRKNSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+74> 0x000055555555d00a <+67>: mov $0x1,%eax 0x000055555555d00f <+72>: jmp 0x55555555d016 <Z18isValidAccountNameRKNSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+79> 0x000055555555d011 <+74>: mov $0x0,%eax 0x000055555555d016 <+79>: test %al,%al 0x000055555555d018 <+81>: je 0x55555555d021 <Z18isValidAccountNameRKNSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+90> 0x000055555555d01a <+83>: mov $0x0,%ebx 0x000055555555d01f <+88>: jmp 0x55555555d063 <Z18isValidAccountNameRKNSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+156> 0x000055555555d021 <+90>: lea -0x40(%rbp),%rax 0x000055555555d025 <+94>: mov $0x10,%edx 0x000055555555d02a <+99>: lea 0x3404a(%rip),%rcx # 0x55555559107b 0x000055555555d031 <+106>: mov %rcx,%rsi 0x000055555555d034 <+109>: mov %rax,%rdi 0x000055555555d037 <+112>: call 0x555555563382 0x000055555555d03c <+117>: lea -0x40(%rbp),%rcx 0x000055555555d040 <+121>: mov -0x48(%rbp),%rax 0x000055555555d044 <+125>: mov $0x0,%edx 0x000055555555d049 <+130>: mov %rcx,%rsi 0x000055555555d04c <+133>: mov %rax,%rdi 0x000055555555d04f <+136>: call 0x555555563453 --Type for more, q to quit, c to continue without paging-- 0x000055555555d054 <+141>: mov %eax,%ebx 0x000055555555d056 <+143>: nop 0x000055555555d057 <+144>: lea -0x40(%rbp),%rax 0x000055555555d05b <+148>: mov %rax,%rdi 0x000055555555d05e <+151>: call 0x555555563420 0x000055555555d063 <+156>: mov %ebx,%eax 0x000055555555d065 <+158>: mov -0x18(%rbp),%rdx 0x000055555555d069 <+162>: sub %fs:0x28,%rdx 0x000055555555d072 <+171>: je 0x55555555d0ad <Z18isValidAccountNameRKNSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+230> 0x000055555555d074 <+173>: jmp 0x55555555d0a8 <Z18isValidAccountNameRKNSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+225> 0x000055555555d076 <+175>: endbr64 0x000055555555d07a <+179>: mov %rax,%rbx 0x000055555555d07d <+182>: lea -0x40(%rbp),%rax 0x000055555555d081 <+186>: mov %rax,%rdi 0x000055555555d084 <+189>: call 0x555555563420 0x000055555555d089 <+194>: mov %rbx,%rax 0x000055555555d08c <+197>: mov -0x18(%rbp),%rdx 0x000055555555d090 <+201>: sub %fs:0x28,%rdx 0x000055555555d099 <+210>: je 0x55555555d0a0 <Z18isValidAccountNameRKNSt7_cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+217> 0x000055555555d09b <+212>: call 0x55555555c190 <stack_chk_fail@plt> 0x000055555555d0a0 <+217>: mov %rax,%rdi 0x000055555555d0a3 <+220>: call 0x55555555c540 _Unwind_Resume@plt 0x000055555555d0a8 <+225>: call 0x55555555c190 __stack_chk_fail@plt 0x000055555555d0ad <+230>: mov -0x8(%rbp),%rbx 0x000055555555d0b1 <+234>: leave 0x000055555555d0b2 <+235>: ret End of assembler dump. (gdb) break *0x000055555555d0b2 Breakpoint 2 at 0x55555555d0b2 (gdb) continue Continuing.

Breakpoint 2, 0x000055555555d0b2 in isValidAccountName(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) () (gdb) set $rax=0x1 (gdb) continue Continuing. Connecting with the Bank Server... Response from the Bank Server: Account has been created successfully! Your details are as follow: Account Name: @@@@ Account Balance: 10.00

[Inferior 1 (process 12436) exited normally] (gdb)