Jira (PDB-2488) Don't accept trailing garbage in query string

0 views
Skip to first unread message

Rob Browning (JIRA)

unread,
Mar 1, 2016, 12:21:04 PM3/1/16
to puppe...@googlegroups.com
Rob Browning created an issue
 
PuppetDB / Bug PDB-2488
Don't accept trailing garbage in query string
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2016/03/01 9:20 AM
Priority: Normal Normal
Reporter: Rob Browning

Right now, this will succeed, returning all facts, and it shouldn't:

curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] ["not" ["=", "certname", "security-sensitive-host"]]'

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc)
Atlassian logo

Zachary Kent (Jira)

unread,
Jan 11, 2021, 8:20:04 PM1/11/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Labels: tsr-pdb-backlog
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Zachary Kent (Jira)

unread,
Jan 12, 2021, 2:05:04 PM1/12/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Right now, this will succeed, returning all facts, and it shouldn't:

{code}
curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] ["not" ["=", "certname", "security-sensitive-host"]]'
{code}
 

Zachary Kent (Jira)

unread,
Jan 12, 2021, 2:06:03 PM1/12/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Right now, this will succeed, returning all facts, and it shouldn't:
{code}curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] ["not" ["=", "certname", "security-sensitive-host"]]'
{code}
 


Another example: 
{code:java}curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] this-is-trailing-garbage-and-not-part-of-the-query'
{code}
 

Zachary Kent (Jira)

unread,
Jan 12, 2021, 2:11:03 PM1/12/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Right now, this will succeed, returning all facts, and it shouldn't:
{code}curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] ["not" ["=", "certname", "security-sensitive-host"]]'
{code}
In the example above there isn't an enclosing set of brackets so there are two ast forms submitted but only the first is evaluated.  

 

Another example: 
{code:java}curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] this-is-trailing-garbage-and-not-part-of-the-query'
{code}
 

Zachary Kent (Jira)

unread,
Jan 12, 2021, 2:13:04 PM1/12/21
to puppe...@googlegroups.com

Zachary Kent (Jira)

unread,
Jan 12, 2021, 2:44:03 PM1/12/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Right now, this will succeed, returning all facts, and it shouldn't:
{code}curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] ["not" ["=", "certname", "security-sensitive-host"]]'
{code}
In the example above there isn't an enclosing set of brackets so there are two ast forms submitted but only the first ["from", "facts"]  is evaluated. 


 

Another example: 
{code:java}curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] this-is-trailing-garbage-and-not-part-of-the-query'
{code}
 

Zachary Kent (Jira)

unread,
Jan 12, 2021, 2:45:04 PM1/12/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Right now, this will succeed, returning all facts, and it shouldn't:
{code}curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] ["not" ["=", "certname", "security-sensitive-host"]]'
{code}
In the example above there isn't an enclosing set of brackets so there are two ast forms submitted but only the first ["from", "facts"] is evaluated. 

 

Another example: 
{code:java}curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] this-is-trailing-garbage-and-not-part-of-the-query -that-gets-evaluated '
{code}
 

Zachary Kent (Jira)

unread,
Jan 12, 2021, 3:01:03 PM1/12/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Right now, this will succeed, returning all facts, and it shouldn't:
{code}curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] ["not" ["=", "certname", "security-sensitive-host"]]'
{code}
In the example above there isn't an enclosing set of brackets so there are two ast forms submitted but only the first ["from", "facts"] is evaluated. 

 

Another example: 
{code:java}curl -X GET http://localhost:8080/pdb/query/v4?pretty=true --data-urlencode 'query=["from","facts"] this-is-trailing-garbage-and-not-part-of-the-query-that-gets-evaluated'
{code}
 


We should error when this happens and indicate in that there was more than one form submitted in the query. It may be possible to do this by adding another func in [middleware.clj|https://github.com/puppetlabs/puppetdb/blob/master/src/puppetlabs/puppetdb/middleware.clj] to the handler that's created in the [build-app|https://github.com/puppetlabs/puppetdb/blob/master/src/puppetlabs/puppetdb/http/server.clj#L62] func.

 

Bogdan Irimie (Jira)

unread,
Jan 13, 2021, 9:36:03 AM1/13/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Jan 13, 2021, 9:57:04 AM1/13/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-27.01.2021

Bogdan Irimie (Jira)

unread,
Jan 27, 2021, 9:03:07 AM1/27/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-27.01.2021 , ready for triage 3

Andrei Filipovici (Jira)

unread,
Jan 27, 2021, 10:34:04 AM1/27/21
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Feb 10, 2021, 9:07:02 AM2/10/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-27.01.2021, ghost-10.02.2021 , ready for triage 3

Bogdan Irimie (Jira)

unread,
Feb 24, 2021, 9:07:03 AM2/24/21
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-27.01.2021, ghost-10.02.2021, ghost-24.02.2021 , ready for triage 3

Zachary Kent (Jira)

unread,
Apr 9, 2021, 5:09:02 PM4/9/21
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Fix Version/s: PDB 7.3.0
Fix Version/s: PDB 6.16.0
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages