Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #4618] rest api fail when service description have slash character #1188

Closed
icinga-migration opened this issue Aug 22, 2013 · 5 comments

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/4618

Created by cropalato on 2013-08-22 04:00:32 +00:00

Assignee: (none)
Status: New
Target Version: Backlog
Last Update: 2015-05-18 12:17:47 +00:00 (in Redmine)

Icinga Version: 1.9.3
Icinga Web Version: 1.9.0
IDO Version: 1.9.3
OS Version: debian wheezy 7.1
DB Type: MySQL
DB Version: 5.5
Browser Version: google chrome 28.0.1500.71

If you have a service with special character in your description and you use rest api to execute a command, icinga-web fail.

How to reproduce the error:

  1. Create a service with a description like "Disk: /opt/data".
  2. After receive a notification, use a link like:
    https://localhost/icinga-web/web/api/cmd/cmd=ACKNOWLEDGE\_SVC\_PROBLEM/authkey=qwrety123/target=\[%7B%22instance%22:%22default%22,%22service%22:%22Disk:%20/opt/data%22,%22host%22:%22test.foo.org%22%7D\]/data=%7B%22sticky%22:%222%22,%22notify%22:%221%22,%22persistent%22:%220%22,%22author%22:%me%22,%22comment%22:%22Acked%20by%20me%22%7D

I can do it with others services without slash.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2013-08-22 07:38:15 +00:00

  • Assigned to deleted mfriedrich

@icinga-migration
Copy link
Author

Updated by mfrosch on 2013-08-23 13:12:40 +00:00

  • Status changed from New to Feedback

Looks like the wrong encoding function is called:

encodeURI('foo: /bar')
"foo:%20/bar"

encodeURIComponent('foo: /bar')
"foo%3A%20%2Fbar"

encodeURIComponent should be used to escape that part.

What is generating that URL?

@icinga-migration
Copy link
Author

Updated by cropalato on 2013-08-26 15:27:59 +00:00

Even if i encode like you said, I face this error. Apache will decode the request before process it.

The requested URL /icinga-web/web/api/cmd/cmd=ACKNOWLEDGE_SVC_PROBLEM/authkey=qwerty123/target=[{instance: /var",host by me"} was not found on this server.

I tried this url:
https://localhost/icinga-web/web/api/cmd/cmd=ACKNOWLEDGE\_SVC\_PROBLEM/authkey=qwerty123/target=\[%7B%22instance%22:%22default%22,%22service%22:%22Disk%3A%20%2Fvar%22,%22host%22:%22test.foo.org%22%7D\]/data=%7B%22sticky%22:%222%22,%22notify%22:%221%22,%22persistent%22:%220%22,%22author%22:%22me%22,%22comment%22:%22Acked%20by%20me%22%7D

by the way, my notification script generate this url.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-03-12 19:43:36 +00:00

  • Status changed from Feedback to New

@icinga-migration
Copy link
Author

Updated by berk on 2015-05-18 12:17:47 +00:00

  • Target Version set to Backlog

@icinga-migration icinga-migration added this to the Backlog milestone Jan 17, 2017
@dnsmichi dnsmichi removed this from the Backlog milestone Dec 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants