fix(security): TLS ssl_verify hardcoding and credential encryption issues#13203
Merged
Baoyuantop merged 1 commit intoApr 17, 2026
Merged
Conversation
AlinsRan
force-pushed
the
fix/tls-ssl-verify-credential-encryption
branch
2 times, most recently
from
April 14, 2026 09:14
e74a195 to
633ffc6
Compare
…sues - wolf-rbac: add configurable ssl_verify field (default nil/false) to plugin schema; thread through http_req/http_get/check_url_permission/ request_to_wolf_server; fix check_schema to run schema validation before check_https; add check_tls_bool call - ai-rag: add ssl_verify field (default true) to plugin schema; pass ssl_verify to embeddings and vector-search driver request_uri calls; also remove stray 'type = object' line from properties table - ai-rag/embeddings/azure_openai: accept ssl_verify param and pass to request_uri - ai-rag/vector-search/azure_ai_search: accept ssl_verify param and pass to request_uri - aws-lambda: add encrypt_fields for authorization.apikey, authorization.iam.accesskey, and authorization.iam.secretkey so credentials are stored encrypted at rest in etcd
AlinsRan
force-pushed
the
fix/tls-ssl-verify-credential-encryption
branch
from
April 15, 2026 00:22
633ffc6 to
f35a930
Compare
Baoyuantop
approved these changes
Apr 15, 2026
membphis
approved these changes
Apr 15, 2026
nic-6443
approved these changes
Apr 15, 2026
Merged
5 tasks
wistefan
pushed a commit
to wistefan/apisix
that referenced
this pull request
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix multiple TLS and credential-encryption vulnerabilities across several plugins, and a bug in the shared
check_httpsutility.wolf-rbac:
ssl_verifyhardcoded tofalsehttp_req()passedssl_verify = falseunconditionally toresty.http, so TLS certificate verification was always disabled regardless of the server endpoint. There was also no schema field to let users enable it.Additionally,
request_to_wolf_server()logged the full response body at both info and error level —core.log.info("request [...] success! response body:", core.json.delay_encode(body))— which could leak wolf tokens and user PII into the error log.Fix: Add
ssl_verifyboolean field to the consumer schema (nil by default). Thread it throughhttp_req(),http_get(),check_url_permission(), andrequest_to_wolf_server(). Remove full response body from log statements; retain onlybody.reasonon error.ai-rag: Azure HTTPS calls without certificate verification
Both
azure_openai.get_embeddings()andazure_ai_search.search()calledhttpc:request_uri(endpoint, { ..., body = body_tab })with nossl_verifyfield, soresty.httpperformed no certificate verification for the Azure HTTPS endpoints.Fix: Add
ssl_verifyboolean field (defaulttrue) to the plugin schema. Pass it to both driverrequest_uri()calls. Addcheck_httpswarnings forembeddings_provider.azure_openai.endpointandvector_search_provider.azure_ai_search.endpoint.aws-lambda: IAM credentials stored as plaintext in etcd
The plugin had no
encrypt_fieldsdeclaration, soauthorization.apikey,authorization.iam.accesskey, andauthorization.iam.secretkeywere stored as plaintext strings in etcd — e.g."secretkey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY".Fix: Add
plugin.schema.encrypt_fieldscovering all three credential paths.core/utils:
check_httpsexits loop early on first missing fieldcheck_httpsusedreturnwhen a field was nil orget_root_confreturned nothing, which exited the entire loop instead of moving to the next field. For example:get_root_confalso had no guard when an intermediate path segment was not a table, which could cause a nil-index panic.Fix: Replace
returnwithgoto continueso all fields are always checked. Add atype(conf) ~= "table"guard inget_root_confto returnnil, nilsafely.Changes
apisix/core/utils.lua—get_root_conf: returnnil, nilif intermediate path is not a table;check_https:goto continueinstead ofreturnapisix/plugins/wolf-rbac.lua— addssl_verifyfield; thread through all HTTP call sites; remove response body from logsapisix/plugins/ai-rag.lua— addssl_verifyfield (defaulttrue); addcheck_httpsandcheck_tls_boolincheck_schema; passssl_verifyto both driver callsapisix/plugins/ai-rag/embeddings/azure_openai.lua— accept and passssl_verifytorequest_uriapisix/plugins/ai-rag/vector-search/azure_ai_search.lua— accept and passssl_verifytorequest_uriapisix/plugins/aws-lambda.lua— addencrypt_fieldsforauthorization.apikey,authorization.iam.accesskey,authorization.iam.secretkeyTests
t/plugin/wolf-rbac.t— TEST 38/39: monkey-patchresty.httpto interceptrequest_uriopts and assertssl_verifyis forwarded correctly for bothfalseandtrue; TEST 40: schema rejects non-boolean valuet/plugin/ai-rag.t— TEST 15/16:ssl_verifydefaults totrueand can be set tofalse; TEST 17: monkey-patchresty.httpto assertssl_verify = falsereaches both the embeddings and vector-searchrequest_uricallst/plugin/aws-lambda.t— TEST 7: cleanup route; TEST 8: write credentials via admin API, read directly from etcd, assert all three fields are stored as ciphertext while admin API returns plaintext