V4Vern / pe

0 stars 0 forks source link

Starred Topics can be bypassed by changing the text file #5

Open V4Vern opened 4 weeks ago

V4Vern commented 4 weeks ago

Description: There is no storage validation check on "saved_topics". There is input validation check on the program to prevent user from entering non-existent topics to your favourite list but this can be bypass by changing the text file.

Steps to Reproduce:

Edit the text file "saved_topics" and add

sadaad asdsad

Actual Result: When I list the starred topics, I can see the non-existent topics

Screenshot:

image.png

nus-se-bot commented 3 weeks ago

Team's Response

No details provided by team.

The 'Original' Bug

[The team marked this bug as a duplicate of the following bug]

Unable to handle corrupt saved_topics.txt file

When saved_topics.txt is manually edited or corrupted via other reasons. The program should probably either clear the starred list or only load legal topic names. But currently the program loads the topic no matter what.

Example:

Hello from
__________________________________________________________________________________________
   _     _                           __             ______                     __
   /|   /                          /    )             /      /               /    )
---/-| -/-----__----------__-------/----/----__-------/------/__----__-------/---------__-
 /  | /    /___)| /| /  (_ `     /    /   /   )     /      /   ) /___)     /  --,   /   )
_/___|/____(___ _|/_|/__(__)_____(____/___/___/_____/______/___/_(___ _____(____/___(___/_

What is your name?
Maodian huang
____________________________________________________________

Hello Maodian huang
____________________________________________________________

What do you want from me?
____________________________________________________________

starred
____________________________________________________________

Here is the list of your favourite topics:
    - Entertainment
    - Technol
    - Sportssadasd
____________________________________________________________

What do you want from me?
____________________________________________________________

suggest
____________________________________________________________

1. Suggesting an article from your favorite topic: Entertainment
   Title: The Matrix has a fifth film in the works and no this is not a simulation  CNN
URL: https://edition.cnn.com/2024/04/03/entertainment/matrix-fifth-movie/index.html
No articles found for the topic: Technol
No articles found for the topic: Sportssadasd

____________________________________________________________

What do you want from me?
____________________________________________________________

[original: nus-cs2113-AY2324S2/pe-interim#2371] [original labels: severity.Low type.FunctionalityBug]

Their Response to the 'Original' Bug

[This is the team's response to the above 'original' bug]

i think it shows that the corrupted file is still handled quite gracefully whereby topics are still read and the system still runs without crashing.

Items for the Tester to Verify

:question: Issue duplicate status

Team chose to mark this issue as a duplicate of another issue (as explained in the Team's response above)

Reason for disagreement: [replace this with your explanation]


## :question: Issue response Team chose [`response.NotInScope`] - [x] I disagree **Reason for disagreement:** The UG doesn't state any potential known issue for storage in the UG. CS2113 Website mentioned that "The user cannot attempt to use the missing feature or when the user does so, the software fails gracefully, possibly with a suitable error message". However, in this case, there is no suitable error message informing the user that the topics are invalid. It only mentioned that there is no article found for that topics which can be quite misleading for the user. ![image.png](https://raw.githubusercontent.com/V4Vern/pe/main/files/aba3957d-9f89-4c00-9b2e-eaf3deb3cf24.png) ![image.png](https://raw.githubusercontent.com/V4Vern/pe/main/files/1d63de86-f2e5-4749-991a-176d8c62e675.png)
## :question: Issue type Team chose [`type.FunctionalityBug`] Originally [`type.FeatureFlaw`] - [ ] I disagree **Reason for disagreement:** [replace this with your explanation]
## :question: Issue severity Team chose [`severity.Low`] Originally [`severity.Medium`] - [x] I disagree **Reason for disagreement:** Some users may occasionally experience inconvenience if the saved_topics.txt file is corrupted due to a system error or malware. For example, they might see a topic listed in the starred command, which can be misleading if there is no corresponding article available or when attempting to filter by that topic. ![image.png](https://raw.githubusercontent.com/V4Vern/pe/main/files/58fc7599-c265-47ba-b759-3e9b57ded8ba.png) ![image.png](https://raw.githubusercontent.com/V4Vern/pe/main/files/5dc006ad-56a4-4f18-916e-d45b2287c60e.png)