-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipeline error for sobelow #158
Comments
Sorry for the delay in response, @MikaAK - there was substantial changes around the migration from things like I will be pushing out the new version to hex shortly, but in the meantime, you should be able to use Sobelow by referencing the GitHub repo in your mix file to use a version that includes all the various changes. |
Hey @MikaAK! I'm all caught up on digging into this issue - ignore my last comment, I was slightly confused 😅 So the primary issue for me in trying to fix this bug is that it is erroring out because of an edge case in the function clauses not matching against whatever you're scanning - presuming that the test cases we have in Sobelow are conclusively testing whether things are working right now (which I'm not sure if they are or not); From what I can tell though - Sobelow is erroring out on It's possible that there is a missing function clause in I am going to keep digging into this issue for sure (and any additional info / context you can give me around your project where available would be helpful), but you may be able to unblock your situation by using CLI arguments to ignore |
I just ran into this issue, so here is some more details. CLI output: > mix sobelow --config
** (FunctionClauseError) no function clause matching in Sobelow.Config.is_vuln_pipeline?/2
The following arguments were given to Sobelow.Config.is_vuln_pipeline?/2:
# 1
{:pipeline, [line: 232, column: 9], nil}
# 2
:csrf
Attempted function clauses (showing 2 out of 2):
def is_vuln_pipeline?({:pipeline, _, [_name, [do: block]]}, :csrf)
def is_vuln_pipeline?({:pipeline, _, [_name, [do: block]]}, :headers)
(sobelow 0.13.0) lib/sobelow/config.ex:123: Sobelow.Config.is_vuln_pipeline?/2
(elixir 1.17.2) lib/stream.ex:523: anonymous fn/4 in Stream.filter/2
(elixir 1.17.2) lib/enum.ex:4858: Enumerable.List.reduce/3
(elixir 1.17.2) lib/stream.ex:1891: Enumerable.Stream.do_each/4
(elixir 1.17.2) lib/enum.ex:4423: Enum.each/2
(elixir 1.17.2) lib/enum.ex:987: Enum."-each/2-lists^foreach/1-0-"/2
(sobelow 0.13.0) lib/sobelow.ex:94: Sobelow.run/0
(mix 1.17.2) lib/mix/task.ex:495: anonymous fn/3 in Mix.Task.run_task/5 This is a Phoenix project with Absinthe installed. The router includes code like this: scope "/graphql" do
pipe_through([:api, :graphql_context])
forward(
"/",
Absinthe.Plug,
analyze_complexity: true,
schema: MyAppWeb.Schema,
pipeline: {__MODULE__, :graphql_pipeline},
json_codec: Jason
)
end
def graphql_pipeline(config, pipeline_opts) do
secure? =
:my_app
|> Application.get_env(MyAppWeb.Endpoint, [])
|> Keyword.get(:secure?, false)
config.schema_mod
|> Absinthe.Pipeline.for_document(pipeline_opts)
|> then(fn pipeline ->
if secure? do
pipeline
|> Absinthe.Pipeline.without(Phase.Schema.Introspection)
|> Absinthe.Pipeline.insert_before(
Absinthe.Phase.Document.Validation.Result,
MyAppWeb.Phase.RemoveSuggestions
)
else
pipeline
end
end)
end edit: Instead of using the variable |
Having an issue on one of our apps, i've tested this using #157 and the issue persists
The text was updated successfully, but these errors were encountered: