Repo indexer - empty results for specific documents #1461

Closed
opened 2025-11-02 04:01:35 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @ghost on GitHub (Jan 16, 2018).

gitea master version number d29aa76

Trying to use repository indexer, I seen that some results for specific documents (like JSP and JRXML), doesn't show the context:

immagine

The line numbers are rights, but not text is showed in result.

To replicate this kind of problem, try to clone this test repo: https://github.com/1212050/Shopping-web-Jsp-Servlet
and try to search for "jsp" text.
You will see:
immagine

Originally created by @ghost on GitHub (Jan 16, 2018). gitea master version number d29aa76 Trying to use repository indexer, I seen that some results for specific documents (like JSP and JRXML), doesn't show the context: ![immagine](https://user-images.githubusercontent.com/6648129/34994357-85213d50-fad3-11e7-8e08-4ef6e44a45b7.png) The line numbers are rights, but not text is showed in result. To replicate this kind of problem, try to clone this test repo: [https://github.com/1212050/Shopping-web-Jsp-Servlet](url) and try to search for "jsp" text. You will see: ![immagine](https://user-images.githubusercontent.com/6648129/34994540-28e74f38-fad4-11e7-81ed-752934521feb.png)
GiteaMirror added the type/bugtopic/security labels 2025-11-02 04:01:35 -06:00
Author
Owner

@lunny commented on GitHub (Jan 16, 2018):

Maybe an encoding problem?

@lunny commented on GitHub (Jan 16, 2018): Maybe an encoding problem?
Author
Owner

@thehowl commented on GitHub (Jan 16, 2018):

Hmmm... tested this on my own and... uhhh... why exactly is this not escaped?

(search HTML)

image

(original file)

image

This can be seen pretty clerarly by XML tags being encoded as they are.

image

@lunny This is pretty critical because it's XSS. Please add to 1.4.0 and kind/security.

@thehowl commented on GitHub (Jan 16, 2018): Hmmm... tested this on my own and... uhhh... why exactly is this not escaped? (search HTML) ![image](https://user-images.githubusercontent.com/4681308/34994986-78b7d0f4-fad5-11e7-8ef9-d1aca716ada6.png) (original file) ![image](https://user-images.githubusercontent.com/4681308/34995010-8947550c-fad5-11e7-8689-b3743ca96e67.png) This can be seen pretty clerarly by XML tags being encoded as they are. ![image](https://user-images.githubusercontent.com/4681308/34995070-ba9782c6-fad5-11e7-8180-b8cf4471562b.png) @lunny This is pretty critical because it's XSS. Please add to 1.4.0 and kind/security.
Author
Owner

@ghost commented on GitHub (Jan 17, 2018):

Thank you @thehowl , so, it's only needed to escape some additional strings to view the file text context, right?

@ghost commented on GitHub (Jan 17, 2018): Thank you @thehowl , so, it's only needed to escape some additional strings to view the file text context, right?
Author
Owner

@thehowl commented on GitHub (Jan 17, 2018):

Yes, that's right.

@thehowl commented on GitHub (Jan 17, 2018): Yes, that's right.
Author
Owner

@ghost commented on GitHub (Jan 22, 2018):

Thank you very much guys. I will test that PR on master release as soon as drone will be able to build/release it

@ghost commented on GitHub (Jan 22, 2018): Thank you very much guys. I will test that PR on master release as soon as drone will be able to build/release it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1461