snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

API result values should be literal strings rather than HTML entities (Maybe a bug?)

Open Sxderp opened this issue 6 years ago • 19 comments

Server (please complete the following information):

  • Snipe Version: 4.7.7
  • OS: RHEL 7
  • Web Server: Apache
  • PHP Version: 7.1

Is your feature request related to a problem? Please describe. When fetching assets that have certain characters in field values or model name those characters are turned into HTML entities. The HTML entities are returned in the API output. The escaping seems to happen in the "Transformer" classes.

Reproduce:

  1. Create a Model with a " in the name.
  2. Create an asset with that model.
  3. Query that asset using the API.
  4. Examine API output. The model name will contain the HTML entity ".

Describe the solution you'd like The API should return literal strings.

Describe alternatives you've considered Manually un-escaping the HTML entities in my scripts.

Sxderp avatar Dec 20 '19 18:12 Sxderp

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Feb 18 '20 20:02 stale[bot]

yes

Sxderp avatar Feb 22 '20 21:02 Sxderp

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] avatar Feb 22 '20 21:02 stale[bot]

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Apr 23 '20 05:04 stale[bot]

yes

Sxderp avatar Apr 23 '20 18:04 Sxderp

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] avatar Apr 23 '20 18:04 stale[bot]

This is unexpected behavior. I would expect the API to output data exactly as input.

Unfortunately, changing this would be a breaking change as existing code is likely expecting current behavior.

It would be good to get this included in v5 with maybe an optional configuration and/or parameter for handling this as desired in v4.

This is something I may be able to help with.

travismiller avatar Jun 04 '20 18:06 travismiller

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Aug 08 '20 07:08 stale[bot]

This is still relevant

On Aug 8, 2020, at 02:24, stale[bot] [email protected] wrote:

still relevant

travismiller avatar Aug 08 '20 13:08 travismiller

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] avatar Aug 08 '20 13:08 stale[bot]

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Oct 12 '20 00:10 stale[bot]

Yes

Sxderp avatar Oct 12 '20 14:10 Sxderp

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] avatar Oct 12 '20 14:10 stale[bot]

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

stale[bot] avatar Dec 25 '20 15:12 stale[bot]

Yes

travismiller avatar Dec 25 '20 15:12 travismiller

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

stale[bot] avatar Dec 25 '20 15:12 stale[bot]

+1

My scripts unescape all returned strings as I'm not exactly sure which strings may have HTML entities in them.

mattcarras avatar Aug 24 '22 20:08 mattcarras

This would leave us open to XSS attacks everywhere that we consume the API.

snipe avatar Aug 24 '22 21:08 snipe

is https://github.com/snipe/snipe-it/commit/9cf5f30c77df6ab60baab1c0e6bb0b4e773f0eae a response to this, or unrelated?

bby-bishopclark avatar Sep 01 '22 16:09 bby-bishopclark