See here how to contribute : https://checkmarx.gitbooks.io/go-scp/content/howto-contribut...
Go Language – Web Application Secure Coding Practices
51–55 of 55 posts
Re: Go Language – Web Application Secure Coding Practices
#52Earlier quoted context omitted.
I'm not sure how `fmt.Printf("%s\n", i) // invalid type` is really that "scary". Expecting the compiler to introspect that Printf's `...interface{}` argument's first value is incorrect, even though `i` does fulfill the stated parameter's type, is a FAR more scary thought.
The important thing here is, that fmt.Printf is just a function which takes a string and a variable amount of interface{} parameters. There is nothing in the language spec which creates a type correlation. the "%s" denotes a string parameter to print is solely some inner working of the Printf function. Yes, you can special case fmt.Printf, as some compilers do, but given the standard go vet tool, I rather think it be…
Re: Go Language – Web Application Secure Coding Practices
#53 http.Handle("/o/", http.StripPrefix("/o/", http.FileServer(http.Dir("/"))))
It's a bit too easy to expose to much of the FS aka "Directory traversal attack". My advice, always deploy into a container.Re: Go Language – Web Application Secure Coding Practices
#54Earlier quoted context omitted.
The important thing here is, that fmt.Printf is just a function which takes a string and a variable amount of interface{} parameters. There is nothing in the language spec which creates a type correlation. the "%s" denotes a string parameter to print is solely some inner working of the Printf function. Yes, you can special case fmt.Printf, as some compilers do, but given the standard go vet tool, I rather think it be…
That's exactly my point. Special casing the compilation of 1 specific set of functions is a scary concept, esp. as the tool that can check the types is already in the go toolchain, AND there are plenty of edge cases that can't be caught anyways, so it can create a false sense of security.
Re: Go Language – Web Application Secure Coding Practices
#55Don't read it, always start with using a good framework. It will do everything for you
Hi homakov, given your experience with security, could you please expand on _why_ we should not this particular guide? I do understand why we should start with using a good framework, and I have so far felt that reading guides also help us understand things to be aware of.