[NEW DATA EXTENSION] Kotlin HTTP4k (core, format-jackson, format-moshi, format-gson, multipart)#26
[NEW DATA EXTENSION] Kotlin HTTP4k (core, format-jackson, format-moshi, format-gson, multipart)#26
Conversation
Agent-Logs-Url: https://github.com/testing-felickz/codeql-development-template/sessions/c2b323fa-771e-4a4d-8876-fa6a463ca2bc Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
…[0] (header name) Agent-Logs-Url: https://github.com/testing-felickz/codeql-development-template/sessions/c2b323fa-771e-4a4d-8876-fa6a463ca2bc Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
|
@copilot evaluate the docs for http4k core and model any additional remote/local sources and sinks for this library https://www.http4k.org/api/http4k-core/index.html Also add models for
|
…, and multipart sources Agent-Logs-Url: https://github.com/testing-felickz/codeql-development-template/sessions/08129f00-891a-47a8-b941-04ebad32a61f Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
…rgument[0..1]) Agent-Logs-Url: https://github.com/testing-felickz/codeql-development-template/sessions/08129f00-891a-47a8-b941-04ebad32a61f Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
Expanded the data extensions across three model files in commits c7b9b78 and b36259f: http4k-core (
http4k-format (
http4k-multipart (
|
|
The models should be stored in a series of YAML data extension files, one for each external API. For example: |
…-jackson, http4k-format-moshi, http4k-format-gson, http4k-multipart Agent-Logs-Url: https://github.com/testing-felickz/codeql-development-template/sessions/845edef4-ae1e-46d7-a82b-6fbcfeb02871 Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
Reorganized in commit 3f4b098. The model files are now split one per external API artifact:
|
📝 Data Extension Information
http4k-core.model.yml,http4k-format-jackson.model.yml,http4k-format-moshi.model.yml,http4k-format-gson.model.yml,http4k-multipart.model.ymlorg.http4k.core(http4k-core),org.http4k.format(http4k-format-jackson, http4k-format-moshi, http4k-format-gson),org.http4k.lens(http4k-multipart)🎯 Description
What This Data Extension Models
Comprehensive models for the http4k Kotlin HTTP toolkit, with one model file per external API artifact:
http4k-core (
http4k-core.model.yml):Request.query(String),Request.queries(String),Request.header(String),Request.headerValues(String),Request.bodyString(),Request.getUri()— all as remote input sourcesResponse.body(String)for html/js-injection,Response.header(String,String)for response-splitting (Argument[0..1]) and request-forgery (Argument[1])Argument[this]→ReturnValueas value, argument values →ReturnValueas taint) for Request/Response method chainshttp4k-format-jackson (
http4k-format-jackson.model.yml):ConfigurableJackson.asA()forunsafe-deserialization(String and InputStream overloads)Argument[0]→ReturnValue) and JSON string parsing viaasJsonObject()http4k-format-moshi (
http4k-format-moshi.model.yml):ConfigurableMoshi.asA()forunsafe-deserialization(String and InputStream overloads)Argument[0]→ReturnValue) and JSON string parsing viaasJsonObject()http4k-format-gson (
http4k-format-gson.model.yml):ConfigurableGson.asA()forunsafe-deserialization(String and InputStream overloads)Argument[0]→ReturnValue) and JSON string parsing viaasJsonObject()http4k-multipart (
http4k-multipart.model.yml):MultipartFormBody.field/fields/fieldValue/fieldValues/file/filesfor form data,MultipartFormFile.getFilename()/getContent()for uploaded file metadata and content,MultipartFormField.getValue()for field values — all as remote sourcesMultipartFormBody.from()taint propagation fromHttpMessageto parsed bodyThreat Model
remote
Example Vulnerable Code
Example Safe Code
📦 Extension Details
Extension YAML
http4k-core.model.yml:
http4k-format-jackson.model.yml:
http4k-format-moshi.model.yml:
http4k-format-gson.model.yml:
http4k-multipart.model.yml:
Access Path Explanation
Request.query→ReturnValueRequest.header→ReturnValueRequest.bodyString→ReturnValueRequest.getUri→ReturnValueResponse.header→Argument[0..1]Response.header→Argument[1]Locationheader for SSRF/redirectResponse.body→Argument[0]ConfigurableJackson.asA→Argument[0]MultipartFormBody.file→ReturnValueMultipartFormFile.getFilename→ReturnValueMultipartFormFile.getContent→ReturnValue🧪 Testing
codeql database createorcodeql test extract)codeql query run --additional-packs=<model-pack-dir>)codeql test run --additional-packs=<model-pack-dir>)📋 Checklist
languages/java/custom/src/)qlpack.ymlincludesdataExtensionsconfiguration🔗 References
Note: This data extension was developed following CodeQL Models as Data best practices.
⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.